@@ -163,6 +163,7 @@ struct V8Platform v8_platform;
163
163
} // namespace per_process
164
164
165
165
#ifdef __POSIX__
166
+
166
167
void SignalExit (int signo, siginfo_t * info, void * ucontext) {
167
168
ResetStdio ();
168
169
raise (signo);
@@ -548,6 +549,7 @@ void TrapWebAssemblyOrContinue(int signo, siginfo_t* info, void* ucontext) {
548
549
struct sigaction sa;
549
550
memset (&sa, 0 , sizeof (sa));
550
551
sa.sa_handler = SIG_DFL;
552
+ sigemptyset (&sa.sa_mask );
551
553
CHECK_EQ (sigaction (signo, &sa, nullptr ), 0 );
552
554
553
555
ResetStdio ();
@@ -574,8 +576,8 @@ void RegisterSignalHandler(int signal,
574
576
struct sigaction sa;
575
577
memset (&sa, 0 , sizeof (sa));
576
578
sa.sa_sigaction = handler;
577
- sa.sa_flags = reset_handler ? SA_RESETHAND : 0 ;
578
579
sigfillset (&sa.sa_mask );
580
+ sa.sa_flags = reset_handler ? SA_RESETHAND : 0 ;
579
581
CHECK_EQ (sigaction (signal , &sa, nullptr ), 0 );
580
582
}
581
583
#endif // __POSIX__
@@ -623,6 +625,7 @@ inline void PlatformInit() {
623
625
// Restore signal dispositions, the parent process may have changed them.
624
626
struct sigaction act;
625
627
memset (&act, 0 , sizeof (act));
628
+ sigemptyset (&act.sa_mask );
626
629
627
630
// The hard-coded upper limit is because NSIG is not very reliable; on Linux,
628
631
// it evaluates to 32, 34 or 64, depending on whether RT signals are enabled.
@@ -675,6 +678,7 @@ inline void PlatformInit() {
675
678
struct sigaction sa;
676
679
memset (&sa, 0 , sizeof (sa));
677
680
sa.sa_sigaction = TrapWebAssemblyOrContinue;
681
+ sigemptyset (&sa.sa_mask );
678
682
sa.sa_flags = SA_SIGINFO;
679
683
CHECK_EQ (sigaction (SIGSEGV, &sa, nullptr ), 0 );
680
684
}
0 commit comments