-
Notifications
You must be signed in to change notification settings - Fork 10
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
segfault on Linux at exit #7
Comments
Yep, I can reproduce on MacOS amd64 as well. It looks like node-webrtc#636 (comment) contains a reasonable solution, thanks for linking the issue. |
Update on this (very late sorry): removing the AsyncContextReleaser and just using |
@duvallj I'm getting the following error on M2. Is it because of the same issue?
|
it seems to be the same issue. Also happens on x64 mac |
Is there anything I can do to help push this along? |
@mikey0000 a testcase to reproduce the issue you're seeing would be nice. My current progress is at https://github.com/WonderInventions/node-webrtc/tree/remove-async-context-releaser, testing whatever testcase you come up with on that branch would also be helpful. |
I'm going to be spending some time on it this coming week. |
FYI I don't run into any hanging on that branch with tests. Still I'm going to look at writing the test to cause the crash. |
Something further that is interesting I moved webrtc to an electron utility process and it stopped crashing (early days as I'm also calling child.kill). I think there is something in the threading that is causing problems for electron, I moved things to a POC for trying this out. I'm not encountering the segfault with node v20 only with electron. Only additional thing I found was in peer_connection_factory.cc it uses the base threading library which states it should be called with Quit not stop
if I've read the notes in thread.h properly // Never call Stop on the current thread. Instead use the inherited Quit still it makes no difference to the crash I see in electron. |
Neither do I on Mac, think it might be a Linux/Windows thing though.
oh good find! I'll make that change
Looked into this more and I fear this just may be some other heisenbug in V8 itself. See nodejs/node#47928 for a very simple reproduction: node -e "const x = []; for(i = 0; i < 112813859; i++){ x[i] = false };" crashes with pretty much the exact same stacktrace on my system. |
FWIW I'm running Linux, so yeah could be a windows thing. So for now can state using utility process which forks it off into a pure nodejs process works as a workaround. |
I'm running into segfault as well. Tests succeed but when trying to complete the process I get: Process finished with exit code 139 (interrupted by signal 11:SIGSEGV) I am running on Fedora linux and it produces the same error on ci github actions (node 22). |
Hi @zacharygriffee! Do you mind sharing the segfault stack trace you're getting? Wondering if it's like the one at the top of the issue (which I may be able to do something about) or like the ones further down (which I am probably not able to do something about) |
Here is the dumped core related to my personal computer. I'm trying to figure out how to get the core dump from the github actions. `
` Let me know if there is anything else you need... if I figure out how to get the dump file for github, I'll post that as well. |
@zacharygriffee oh wow that's completely different... the stack trace seems to be entirely w/i the node binary itself, tho I won't deny it's likely this library is still causing it somehow. A dump file from github or a dump w/ symbols would be useful. |
I spent a good several hours trying to figure out how to get a core dump from github or a dump with symbols from my computer and the npm package segfault-handler won't even install on my system. So I'll post when I get anything else useful I can from the situation. |
I'm unable to get it to work on Linux amd64, it segfaults when it exits.
reproducable code
that you can test with docker
docker run -v $PWD:/src node:18 /bin/sh -c 'cd /src && npm ci && node ./index.js'
here goes the gdb trace from inside docker
it is probably the same issue as in node-webrtc#636; I was unable to build on linux (some missing linked symbols at loadtime) so it'll be hard for me to contribute but tell me if you need more info.
The text was updated successfully, but these errors were encountered: