From 3c8195d16746a4c318e48640c99864cf24042ab5 Mon Sep 17 00:00:00 2001 From: Anatoly Korniltsev Date: Mon, 21 Sep 2020 17:29:19 +0300 Subject: [PATCH] src: fix incorrect SIGSEGV handling in NODE_USE_V8_WASM_TRAP_HANDLER 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: https://github.com/nodejs/node/pull/35282 Reviewed-By: Richard Lau Reviewed-By: Rich Trott Reviewed-By: Minwoo Jung --- src/node.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/node.cc b/src/node.cc index 00cce0fd465541..521cae7757d477 100644 --- a/src/node.cc +++ b/src/node.cc @@ -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)