Skip to content

Commit e93726a

Browse files
addaleaxtargos
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 c244436 commit e93726a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/node.cc

+2-1
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,8 @@ static struct {
326326
}
327327

328328
void StopTracingAgent() {
329-
tracing_agent_->Stop();
329+
if (tracing_agent_)
330+
tracing_agent_->Stop();
330331
}
331332

332333
tracing::Agent* GetTracingAgent() const {

0 commit comments

Comments
 (0)