-
Notifications
You must be signed in to change notification settings - Fork 30k
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
parallel/test-worker-nearheaplimit-deadlock is flaky #50761
Comments
I think the incorrect backtrace is a problem related to calling backtrace in a [[noreturn]] function: #50849. As a matter of fact, |
A function tail calls [[noreturn]] node::Abort will print an incorrect call stack because the frame pc was advanced when calling node::Abort to an invalid op, which may vary on different platforms. Dumps the backtrace in the ABORT macro instead to avoid calling backtrace in a tail [[noreturn]] call. Removes the [[noreturn]] attribute if a function calls backtrace and may be called as a tail statement. [[noreturn]] attribute of public functions like `napi_fatal_error` and `node::OnFatalError` can not be removed as compilers may complain about no return values after the removal. PR-URL: #50849 Refs: #50761 Reviewed-By: Joyee Cheung <[email protected]>
1. Fallback to true when the context is not (yet) initialized with the kAllowCodeGenerationFromStrings field. 2. Fallback to true when the Environment isn't assigned to the context or when the Environment cannot call into JavaScript. PR-URL: #50763 Refs: #50761 Reviewed-By: Vinícius Lourenço Claro Cardoso <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]>
A function tail calls [[noreturn]] node::Abort will print an incorrect call stack because the frame pc was advanced when calling node::Abort to an invalid op, which may vary on different platforms. Dumps the backtrace in the ABORT macro instead to avoid calling backtrace in a tail [[noreturn]] call. Removes the [[noreturn]] attribute if a function calls backtrace and may be called as a tail statement. [[noreturn]] attribute of public functions like `napi_fatal_error` and `node::OnFatalError` can not be removed as compilers may complain about no return values after the removal. PR-URL: #50849 Refs: #50761 Reviewed-By: Joyee Cheung <[email protected]>
1. Fallback to true when the context is not (yet) initialized with the kAllowCodeGenerationFromStrings field. 2. Fallback to true when the Environment isn't assigned to the context or when the Environment cannot call into JavaScript. PR-URL: #50763 Refs: #50761 Reviewed-By: Vinícius Lourenço Claro Cardoso <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]>
This still shows up in the CI occasionally. I happened to get a stack trace locally:
|
The worker heap size before message port creation is roughly 2.2MB. I wonder if we should bump it up a little to avoid failures like this. The near heap limit callback is only invoked during GC, but if we just set the heap size to 0, chances are the heap limit is going to be hit straight away and V8 won't even be able to do a GC and will just go straight to OOM. On the other hand we could probably also just...schedule a throw on the main thread in the OOM handler of the worker? |
Hmm actually not, because the OOM handler doesn't allow returning. I guess we could just bump the limit up a little, and/or ask V8 to not crash the entire process when it's only the V8 heap running out? |
I wonder if we should just allow the test to crash. In that case, V8 runs out of memory because it's performing some operation that forbids GC and therefore can't invoke our callbacks. Technically that means |
A function tail calls [[noreturn]] node::Abort will print an incorrect call stack because the frame pc was advanced when calling node::Abort to an invalid op, which may vary on different platforms. Dumps the backtrace in the ABORT macro instead to avoid calling backtrace in a tail [[noreturn]] call. Removes the [[noreturn]] attribute if a function calls backtrace and may be called as a tail statement. [[noreturn]] attribute of public functions like `napi_fatal_error` and `node::OnFatalError` can not be removed as compilers may complain about no return values after the removal. PR-URL: #50849 Refs: #50761 Reviewed-By: Joyee Cheung <[email protected]>
1. Fallback to true when the context is not (yet) initialized with the kAllowCodeGenerationFromStrings field. 2. Fallback to true when the Environment isn't assigned to the context or when the Environment cannot call into JavaScript. PR-URL: #50763 Refs: #50761 Reviewed-By: Vinícius Lourenço Claro Cardoso <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]>
This may be potentially fixed by https://chromium-review.googlesource.com/c/v8/v8/+/5352288 |
Refs: nodejs/reliability#720
It seems the failure started about 3 days ago, around the time that #48655 landed. I cannot reproduce it locally however.
One peculiar bit I noticed from the error logs:
See full stack trace
It seems strange that the ModifyCodeGenerationFromStrings callback can get called from FatalProcessOutOfMemory. Even if this gets called for OOM somehow, that shouldn't do much unless source maps are enabled, in which case it would call into JavaScript and that's definitely going to crash in OOM.
The text was updated successfully, but these errors were encountered: