mirror of https://github.com/nodejs/node.git
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 <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>pull/8453/merge
parent
83a354c33b
commit
3207ea4e36
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue