Skip to content

Commit

Permalink
src: fix nullptr dereference for signal during startup
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
addaleax authored and rvagg committed Aug 16, 2018
1 parent 1cb9772 commit 8076a79
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,8 @@ static struct {
}

void StopTracingAgent() {
tracing_agent_->Stop();
if (tracing_agent_)
tracing_agent_->Stop();
}

NodePlatform* Platform() {
Expand Down

0 comments on commit 8076a79

Please sign in to comment.