Skip to content

Commit 8076a79

Browse files
addaleaxrvagg
authored andcommitted
src: fix nullptr dereference for signal during startup
This fixes a test failure when running `test/parallel/test-child-process-spawnsync-kill-signal.js` under load. What would happen is that `SignalExit()` tries to shutdown the tracing agent, which might not have been set up by the point that Node.js receives the signal. PR-URL: #20637 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
1 parent 1cb9772 commit 8076a79

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/node.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,8 @@ static struct {
324324
}
325325

326326
void StopTracingAgent() {
327-
tracing_agent_->Stop();
327+
if (tracing_agent_)
328+
tracing_agent_->Stop();
328329
}
329330

330331
NodePlatform* Platform() {

0 commit comments

Comments
 (0)