Skip to content

Commit

Permalink
src: fix incorrect SIGSEGV handling in NODE_USE_V8_WASM_TRAP_HANDLER
Browse files Browse the repository at this point in the history
Pass SA_SIGINFO to sa_flags so the TrapWebAssemblyOrContinue is treated
as sa_sigaction, not sa_handler, otherwise siginfo_t* info contains
some garbage

PR-URL: #35282
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
  • Loading branch information
korniltsev authored and MylesBorins committed Sep 29, 2020
1 parent 0d8eaa3 commit 1e1cb94
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,7 @@ inline void PlatformInit() {
struct sigaction sa;
memset(&sa, 0, sizeof(sa));
sa.sa_sigaction = TrapWebAssemblyOrContinue;
sa.sa_flags = SA_SIGINFO;
CHECK_EQ(sigaction(SIGSEGV, &sa, nullptr), 0);
}
V8::EnableWebAssemblyTrapHandler(false);
Expand Down

0 comments on commit 1e1cb94

Please sign in to comment.