From 5e6ca894cfc50690366a501be52e7248f3574d06 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Wed, 9 May 2018 19:52:53 +0200 Subject: [PATCH] src: fix nullptr dereference for signal during startup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: https://github.com/nodejs/node/pull/20637 Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Tobias Nießen Reviewed-By: Ben Noordhuis --- src/node.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/node.cc b/src/node.cc index d71303570b1a56..5ddbf99150df65 100644 --- a/src/node.cc +++ b/src/node.cc @@ -327,7 +327,8 @@ static struct { } void StopTracingAgent() { - tracing_agent_->Stop(); + if (tracing_agent_) + tracing_agent_->Stop(); } tracing::Agent* GetTracingAgent() const {