Skip to content

Commit 65a6e05

Browse files
committed
src: only block SIGUSR1 when HAVE_INSPECTOR
I'm currently seeing a timeout error for test-signal-handler.js on macosx when using the following configuration: ./configure --debug --without-ssl && make -j8 test --without-ssl implies that there will be no inspector but the signal SIGUSR1 is blocked in PlatformInit just the same. But in this case never unblocked which is causing the signal to never be delivered to the handlers in test-signal-handler.js and it loops until it times out. Not sure if this is the best way of fixing this but hopefully more eyes on this will help. PR-URL: #12266 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent 1807080 commit 65a6e05

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/node.cc

+4
Original file line numberDiff line numberDiff line change
@@ -4074,10 +4074,12 @@ static void DebugEnd(const FunctionCallbackInfo<Value>& args) {
40744074

40754075
inline void PlatformInit() {
40764076
#ifdef __POSIX__
4077+
#if HAVE_INSPECTOR
40774078
sigset_t sigmask;
40784079
sigemptyset(&sigmask);
40794080
sigaddset(&sigmask, SIGUSR1);
40804081
const int err = pthread_sigmask(SIG_SETMASK, &sigmask, nullptr);
4082+
#endif // HAVE_INSPECTOR
40814083

40824084
// Make sure file descriptors 0-2 are valid before we start logging anything.
40834085
for (int fd = STDIN_FILENO; fd <= STDERR_FILENO; fd += 1) {
@@ -4092,7 +4094,9 @@ inline void PlatformInit() {
40924094
ABORT();
40934095
}
40944096

4097+
#if HAVE_INSPECTOR
40954098
CHECK_EQ(err, 0);
4099+
#endif // HAVE_INSPECTOR
40964100

40974101
#ifndef NODE_SHARED_MODE
40984102
// Restore signal dispositions, the parent process may have changed them.

0 commit comments

Comments
 (0)