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 <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
  • Loading branch information
addaleax committed May 10, 2018
1 parent 5a0e379 commit 5e6ca89
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 @@ -327,7 +327,8 @@ static struct {
}

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

tracing::Agent* GetTracingAgent() const {
Expand Down

0 comments on commit 5e6ca89

Please sign in to comment.