-
Notifications
You must be signed in to change notification settings - Fork 30.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
WASI: Crash when terminating a worker thread #33377
Comments
This appears to be a regression in Node 14. I have similar test cases in my wasi-worker module. They pass on Node 13 - but I just tried on Node 14 and see a similar hard crash. |
Be careful when emitting the 'beforeExit' event. It's not allowed to call into the runtime when a termination exception is pending. Fixes: nodejs#33377
Be careful when emitting the 'beforeExit' event. It's not allowed to call into the runtime when a termination exception is pending. Fixes: #33377 PR-URL: #33386 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
Be careful when emitting the 'beforeExit' event. It's not allowed to call into the runtime when a termination exception is pending. Fixes: #33377 PR-URL: #33386 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
Be careful when emitting the 'beforeExit' event. It's not allowed to call into the runtime when a termination exception is pending. Fixes: #33377 PR-URL: #33386 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
Be careful when emitting the 'beforeExit' event. It's not allowed to call into the runtime when a termination exception is pending. Fixes: #33377 PR-URL: #33386 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
Be careful when emitting the 'beforeExit' event. It's not allowed to call into the runtime when a termination exception is pending. Fixes: #33377 PR-URL: #33386 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
I'm running into a very similar issue in node 14.16.1. I'm using the npm workerpool package and when I try to cancel a worker the whole node process dies with
The commit that's supposed to tix this doesn't seem to be merged. Any ideas on how I can resolve this? |
Version: v14.2.0
Platform: Linux x1 5.6.11-arch1-1 #1 SMP PREEMPT Wed, 06 May 2020 17:32:37 +0000 x86_64 GNU/Linux
Subsystem: WASI, worker_threads
What steps will reproduce the bug?
The idea is that I want to detect long running code in a worker. And terminate the worker after some timeout (3000ms in my case). Everything is working fine for normal JS code in the worker. When I use WASM in my worker nodejs crashes with a fatal error (see stack trace further below)
Here is the minimal test case I could produce:
How often does it reproduce? Is there a required condition?
Always reproducible
What is the expected behavior?
The worker thread is terminated and the main thread continues
What do you see instead?
NodeJS is crashing with
Additional information
Obviously I am using the experimental WASI interface. I therefore run node with
node --experimental-wasi-unstable-preview1 --experimental-wasm-bigint index.js
The text was updated successfully, but these errors were encountered: