From 8076a793ed9ef3656a4e17a67edd093bae70b75e 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 7b3482c78d50e2..621e59fcb64570 100644 --- a/src/node.cc +++ b/src/node.cc @@ -324,7 +324,8 @@ static struct { } void StopTracingAgent() { - tracing_agent_->Stop(); + if (tracing_agent_) + tracing_agent_->Stop(); } NodePlatform* Platform() {