-
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
FATAL ERROR: v8::FromJust Maybe value is Nothing #56020
Comments
Hi, thanks for the report. Would you mind adding the whole backtrace? Also a smaller repro case would be handy; like a code snippet. |
Hi @juanarbol 👋🏼
Here is the full log: FATAL ERROR: v8::FromJust Maybe value is Nothing
----- Native stack trace -----
1: 0x100cc7d74 node::OnFatalError(char const*, char const*)
2: 0x100e58404 v8::api_internal::FromJustIsNothing()
3: 0x100d7f89c node::worker::Worker::JoinThread()
4: 0x100c69090 node::Environment::RunAndClearNativeImmediates(bool)::$_7::operator()(node::CallbackQueue<void, node::Environment*>*) const
5: 0x100c68788 node::Environment::RunAndClearNativeImmediates(bool)
6: 0x100c6ca50 node::Environment::InitializeLibuv()::$_1::__invoke(uv_async_s*)
7: 0x1016a1b30 uv__async_io
8: 0x1016b3c08 uv__io_poll
9: 0x1016a20f4 uv_run
10: 0x100bf16f0 node::SpinEventLoopInternal(node::Environment*)
11: 0x100d7f3c0 node::worker::Worker::Run()
12: 0x100d82a1c node::worker::Worker::StartThread(v8::FunctionCallbackInfo<v8::Value> const&)::$_3::__invoke(void*)
13: 0x19bfd9f94 _pthread_start [/usr/lib/system/libsystem_pthread.dylib]
14: 0x19bfd4d34 thread_start [/usr/lib/system/libsystem_pthread.dylib]
The minimum repro case is documented above, I wasn't able to make it smaller 🤷🏼 You need to run |
Seems to be caused by the https://github.com/nodejs/node/blob/main/src/node_worker.cc#L457-L459 I'm not yet sure why. Maybe the object or context it belongs to is no longer valid at that point? |
Strange...in this code: object()->Set(env()->context(),
env()->message_port_string(),
Undefined(env()->isolate())).Check();
And yet calling Doing Seems like |
Seems to be triggering the immediate scheduled in
Note the |
I don't know why this is happening, but the code is not safe. |
Yeah. That would seem to be the case. Not sure why we're doing this here an not somewhere else? Or if we even need to do it at all if the thread is getting disposed anyway? |
This issues seems not to reproduce on v22+. It appears to be a race condition though, so I've opened a PR (#56191) anyway, which is not exactly a fix per se, but at least would ensure that particular crash doesn't happen again. Quite possibly deeper issues in there though as there seems to be a lack of thread coordination between the worker teardown paths. |
Version
v20.18.0
Platform
Subsystem
No response
What steps will reproduce the bug?
Checkout the branch
chore/node/v8-fatal-error-reproduction
of this repo. Then:You'll get:
How often does it reproduce? Is there a required condition?
Always.
If you add a comment on the 2nd call to
pino
(line6
), it doesn't occur.What is the expected behavior? Why is that the expected behavior?
Node should handle the shutdown differently, instead of throwing.
What do you see instead?
A stack trace of the error from v8
Additional information
I'm available to provide further information if this can help to fix the bug 😊
No response
The text was updated successfully, but these errors were encountered: