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 <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
  • Loading branch information
korniltsev authored and sbaayel committed Aug 14, 2023
1 parent b6d3124 commit 3c8195d
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 3c8195d

Please sign in to comment.