From 3ce6eaa3b95bde984631e9d4eef40eb2a669d34d Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Mon, 5 Sep 2016 14:07:28 +0200 Subject: [PATCH] doc: note that listening on SIGSEGV & co is unsafe Note that trying to listen for some signals using `process.on()` is unsafe in the `process` docs. PR-URL: https://github.com/nodejs/node/pull/8410 Reviewed-By: Ben Noordhuis Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- doc/api/process.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/api/process.md b/doc/api/process.md index 5f967d21159245..fd67f55dbe2e1d 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -422,6 +422,11 @@ It is important to take note of the following: * `SIGKILL` cannot have a listener installed, it will unconditionally terminate Node.js on all platforms. * `SIGSTOP` cannot have a listener installed. +* `SIGBUS`, `SIGFPE`, `SIGSEGV` and `SIGILL`, when not raised artificially + using kill(2), inherently leave the process in a state from which it is not + safe to attempt to call JS listeners. Doing so might lead to the process + hanging in an endless loop, since listeners attached using `process.on()` are + called asynchronously and therefore unable to correct the underlying problem. *Note*: Windows does not support sending signals, but Node.js offers some emulation with [`process.kill()`][], and [`ChildProcess.kill()`][]. Sending