summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2018-05-09 19:52:53 +0200
committerMichaël Zasso <targos@protonmail.com>2018-05-12 17:33:54 +0200
commite93726ad10ee240c8b86a5522f69144eeb9a06f5 (patch)
tree4f6826ebe8b6407502dcda9e85f633297648db8f
parentc24443670785ff98b9a9ecc19fbf53cf6d020c72 (diff)
downloadnode-new-e93726ad10ee240c8b86a5522f69144eeb9a06f5.tar.gz
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: https://github.com/nodejs/node/pull/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>
-rw-r--r--src/node.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/node.cc b/src/node.cc
index 704bdc334b..bcc3971bbe 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -326,7 +326,8 @@ static struct {
}
void StopTracingAgent() {
- tracing_agent_->Stop();
+ if (tracing_agent_)
+ tracing_agent_->Stop();
}
tracing::Agent* GetTracingAgent() const {