-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uncaught TypeError: Cannot read property 'syscall' of null #16503
Comments
we are seeing similar issues in our Sentry logs after upgrading to Ember 3.1 🤔 the stacktraces are not giving any hints unfortunately. this is one example from Safari:
and another from Chrome:
|
Similar here. I did some debugging, and this is what I found so far: |
Moreover, |
If I look at the implementation of the class this.heap = new Uint16Array(0x100000); If something is pushed on the heap, then there is no size checking: push(item: number): void {
this.heap[this.offset++] = item;
} This is a problem with A simple test let heap = new Uint16Array(2);
heap.length; produces heap[3]=1;
heap.length; produces |
@pieter-v - I agree, that seems likely to be the issue. Thank you for digging! Can you report the specific issue to glimmer-vm (so we can coordinate solving over there)? @krisselden / @chadhietala / @wycats / @tomdale - how should we address expanding the heap when it’s reached it’s max capacity? |
Hi all, thanks for the quick work on this! |
@urbany as far as I know the best option for now is to stay on Ember 3.0 until this is resolved |
I shouldn't have run the |
Maybe next time around I won't wait a month to report, I was pretty determined it was something in one of our components though. I have a question that will probably just highlight the fact that I know nothing of the glimmer-vm internals. Is this heap growing constantly between transitioning in and out of this route a sign of anything else that I should be looking to mitigate in general? |
@nullrocket my concern is something is regenerating opcodes that should be using what is already compiled. Specifically if it is alway pushComponentDefinition wondering if it is always seeing a new definition for something it should see an existing definition for. This still smells off for me. |
@rwjblue I'm not sure we should close this. You may have address the crash, I'm not confident this has been fully root caused. I'm wondering if there is some idiom people do that messes up the caching that is not covered in the test suite. |
@krisselden I do have a component that has the following template in the route that causes the error, perhaps the component helper is related to the problem, I will dig a bit deeper. This fix did help but I've opened another issue that seems to be related to continually growing opcodes. #16532 {{#each items as |item|}}
{{component itemComponent options=args }}
{{/each}} |
Edited The reproduction transitions between two routes with this template in each route, after some number of transitions it will throw the error. Currently it throws the error I'm experiencing in #16532 but if you switch ember-source to 3.1.0 you can duplicate this error {{my-component text=item}}
{{my-component text=item}}
... about 600 more
https://github.com/nullrocket/glimmer-crash |
I'm experiencing the same issue since upgrading to Ember 3.1.1. In my app, it occurs after transitioning between two 'tab' states multiple times (between 5-10 transitions) and errors on a tab's child component scheduling a function using Ember runloop's I can prevent the error by using |
@krisselden - Agreed, reopened. 😃 @nullrocket / @willviles - Can you test with the latest release build to confirm it is working? The following will get you the current tarball URL:
Then you can update your
|
@rwjblue - I can confirm the issue has been resolved in my app! Thank you! |
@rwjblue I also confirm that |
Awesome, thank you for testing! I’ll try to take some time today and poke at things with @krisselden to try and see if we have another underlying issue before releasing 3.1.1. Will try to update here to let y’all know... |
I tested the project linked in #16532 with the latest ember release right now
And the problem reported in #16532 still occurs |
FYI - This issue is still an ongoing problem, but we need a reproduction (like we had https://github.com/nullrocket/glimmer-crash for #16532). I believe that #16503 (comment) roughly describes the issue. @nullrocket - Do you have a minute to try the technique you did in FWIW - The fix we landed in #16527 and glimmerjs/glimmer-vm#798 was still needed, we just want to avoid needing to grow the heap needlessly (in this case there appears to be a leak)... |
@rwjblue I pushed two branches to the repo https://github.com/nullrocket/glimmer-crash/tree/each-component-3-1-0 This is the original setup with https://github.com/nullrocket/glimmer-crash/tree/each-component-source-release This is the original setup with |
Awesome, thank you very much @nullrocket! |
I tested https://github.com/nullrocket/glimmer-crash/compare/each-component-3-1-0 with the changes from #16558 linked locally, and after running through all 200 iterations there is no heap growth. |
Closing this issue as the underlying bug has been fixed (and confirmed with the demo repos provided). If additional issues crop up, we should report as a new issue with a reproduction. |
@rwjblue unfortunately I don't have a reproduction yet, but I'm seeing a similar error with v3.1.2. According to the Sentry traces there was also a previous error thrown that might have caused the Glimmer VM to throw up later. The previous errors seems to be that during |
We're experiencing the same issue with 3.1.2.
|
I can produce it reliably here. Our app is behind some auth at the min but I can share some credentials with anyone who is able to take a look. |
Also seeing this still on 3.1.2
|
I'm still seeing this on 3.1.2 as well, though less often than 3.1.0 |
Please open a new issue with as much info as you can! As you can see from the back and forth here it will almost certainly take a reproduction for us to be able to track it down, so the sooner we gather enough info for one the faster we can fix... |
Not sure if this is helpful but |
I'm still seeing it in production logs occasionally but it isn't the same cause as this issue as far as I can tell, it is something similar to what @sammynave said, not imports in our case although I have seen it there but unrelated/uncaught exceptions, once corrected it fixes it, this error makes it hard/impossible to trace where the issue is though, I've just gotten good at guessing. |
i never see this in development, only in production builds. |
The root issue is caused by the program counter being set to an invalid offset in the heap. If it tries to invoke an opcode at that offset and there's nothing there, you will get the above I suspect what's happening is that an exception is getting thrown somewhere during render that we're not catching and cleaning up appropriately. We can add better logging to track it down but that may not help if people are only seeing this in production where logging and assertions would be stripped. I would expect though that Ember would re-throw the error, so the initial error should be visible in logs as well. The VM itself doesn't try to catch exceptions, although maybe we should start doing so to try to be more aggressive about cleaning up the state of the VM. |
I can definitely confirm that suspicion. Every instance of the syscall error that I see in our sentry logs has some other error in the log before it. As mentioned in #16503 (comment), a lot of the times |
Not having an error surface would be a very valid cause of this issue, especially as we can't seem to spot this on development, but getting constant reports on sentry and user reports of app issues. What can I do to help debug? |
I can get this to occur in 3.2 while developing. I would love to help. Please let me know how I can do that. |
@tylerturdenpants can you reproduce it in a fresh |
I just got this as well, as soon as I thought I had finished upgrading to 3.2. Dont have a reproducable repo yet tho |
We have encountered such error on 3.5. Any ideas? |
Apologies if I'm incorrect here, but I may have a minimal reproduction of this issue that works in dev? I have a full app that tends to throw this I was able to reproduce the issue that I'm experiencing just by generating a new app with 3.15.1, then creating an index template containing a nonsense component name (to create a compilation error).
Reproduction repo is here: https://github.com/sethbrasile/possible-ember-issue-reproduction-16503 |
We ran into this with Ember 3.12 when trying to convert a pod component to a co-located: It works as a Pod Component:
But not as a co-located component, errors with
Even with deleting everything in the component and template to simplify it, the syscall error still occurs. But trying this on our Ember upgrade to 3.19 PR, we don't get an error. |
I have been banging my head against this every time I try to update from 3.0.0 to any >= 3.1 version beta or final.
It happens after transitioning in and out of a particular route exactly 3 times. Unfortunately I'm unable to create a reproduction except in this application and the stacktrace doesn't point to anything I can dig into. Any idea where I can start looking?
The text was updated successfully, but these errors were encountered: