Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e70b052

Browse filesBrowse files
addaleaxMylesBorins
authored andcommitted
src: remove invalid ToLocalChecked in EmitBeforeExit
This call can fail, we should not use `.ToLocalChecked()` here. In the long run, we should use variants of `EmitExit()` and `EmitBeforeExit()` that avoid this problem by properly propagating empty `MaybeLocal`s. Example failure: 21:07:17 not ok 2564 parallel/test-worker-terminate-source-map 21:07:17 --- 21:07:17 duration_ms: 0.385 21:07:17 severity: crashed 21:07:17 exitcode: -6 21:07:17 stack: |- 21:07:17 FATAL ERROR: v8::ToLocalChecked Empty MaybeLocal. 21:07:17 1: 0x1012f04a5 node::Abort() (.cold.1) [/Users/iojs/build/workspace/node-test-commit-osx/nodes/osx1015/out/Release/node] 21:07:17 2: 0x1000b52d9 node::Abort() [/Users/iojs/build/workspace/node-test-commit-osx/nodes/osx1015/out/Release/node] 21:07:17 3: 0x1000b543f node::OnFatalError(char const*, char const*) [/Users/iojs/build/workspace/node-test-commit-osx/nodes/osx1015/out/Release/node] 21:07:17 4: 0x1001ffd70 v8::V8::ToLocalEmpty() [/Users/iojs/build/workspace/node-test-commit-osx/nodes/osx1015/out/Release/node] 21:07:17 5: 0x1000079b8 node::EmitBeforeExit(node::Environment*) [/Users/iojs/build/workspace/node-test-commit-osx/nodes/osx1015/out/Release/node] 21:07:17 6: 0x100156fea node::worker::Worker::Run() [/Users/iojs/build/workspace/node-test-commit-osx/nodes/osx1015/out/Release/node] 21:07:17 7: 0x10015a4d2 node::worker::Worker::StartThread(v8::FunctionCallbackInfo<v8::Value> const&)::$_3::__invoke(void*) [/Users/iojs/build/workspace/node-test-commit-osx/nodes/osx1015/out/Release/node] 21:07:17 8: 0x7fff72fe7109 _pthread_start [/usr/lib/system/libsystem_pthread.dylib] 21:07:17 9: 0x7fff72fe2b8b thread_start [/usr/lib/system/libsystem_pthread.dylib] 21:07:17 ... PR-URL: #35484 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Richard Lau <rlau@redhat.com>
1 parent a6f58c0 commit e70b052
Copy full SHA for e70b052

File tree

Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed
Open diff view settings
Collapse file

‎src/api/hooks.cc‎

Copy file name to clipboardExpand all lines: src/api/hooks.cc
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ void EmitBeforeExit(Environment* env) {
4545
Local<Integer> exit_code;
4646
if (!exit_code_v->ToInteger(env->context()).ToLocal(&exit_code)) return;
4747

48-
ProcessEmit(env, "beforeExit", exit_code).ToLocalChecked();
48+
// TODO(addaleax): Provide variants of EmitExit() and EmitBeforeExit() that
49+
// actually forward empty MaybeLocal<>s (and check env->can_call_into_js()).
50+
USE(ProcessEmit(env, "beforeExit", exit_code));
4951
}
5052

5153
int EmitExit(Environment* env) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.