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: nodejs#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 joesepi committed Oct 22, 2020
1 parent 07a8787 commit 5b497d2
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 @@ -661,6 +661,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);
}
#endif // defined(_WIN32)
Expand Down

0 comments on commit 5b497d2

Please sign in to comment.