Skip to content

Commit

Permalink
doc: note that listening on SIGSEGV & co is unsafe
Browse files Browse the repository at this point in the history
Note that trying to listen for some signals using `process.on()`
is unsafe in the `process` docs.

PR-URL: #8410
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
addaleax authored and Fishrock123 committed Sep 14, 2016
1 parent 0d24247 commit 3ce6eaa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions doc/api/process.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3ce6eaa

Please sign in to comment.