Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

child_process.spawnSync returns status=0 when signal=SIGKILL #11284

Closed
brandones opened this issue Feb 10, 2017 · 1 comment
Closed

child_process.spawnSync returns status=0 when signal=SIGKILL #11284

brandones opened this issue Feb 10, 2017 · 1 comment
Labels
child_process Issues and PRs related to the child_process subsystem.

Comments

@brandones
Copy link

  • Version: v6.9.5
  • Platform: Linux 1a7889358561 4.8.6-x86_64-linode78 deps: update openssl to 1.0.1j #1 SMP Tue Nov 1 14:51:21 EDT 2016 x86_64 Linux
  • Subsystem: child_process

When the process forked by child_process.spawnSync is send SIGKILL, the returned object has status == 0 while signal == SIGKILL. This differs from the behavior of child_process.spawn, for which the Exit event handler is called with status == null and signal == SIGKILL, per the documentation.

Reproduction at https://github.com/brandones/nodejs-child-process-bug-repro

@mscdex mscdex added the child_process Issues and PRs related to the child_process subsystem. label Feb 10, 2017
@cjihrig
Copy link
Contributor

cjihrig commented Feb 10, 2017

Proposed fix in #11288.

cjihrig added a commit to cjihrig/node that referenced this issue Feb 14, 2017
This commit sets the spawnSync() exit code to null when the
child is killed via signal. This brings the behavior more in
sync with spawn().

Fixes: nodejs#11284
PR-URL: nodejs#11288
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
italoacasas pushed a commit to italoacasas/node that referenced this issue Feb 16, 2017
This commit sets the spawnSync() exit code to null when the
child is killed via signal. This brings the behavior more in
sync with spawn().

Fixes: nodejs#11284
PR-URL: nodejs#11288
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
italoacasas pushed a commit that referenced this issue Feb 22, 2017
This commit sets the spawnSync() exit code to null when the
child is killed via signal. This brings the behavior more in
sync with spawn().

Fixes: #11284
PR-URL: #11288
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
jasnell pushed a commit that referenced this issue Mar 7, 2017
This commit sets the spawnSync() exit code to null when the
child is killed via signal. This brings the behavior more in
sync with spawn().

Fixes: #11284
PR-URL: #11288
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
MylesBorins pushed a commit that referenced this issue Mar 9, 2017
This commit sets the spawnSync() exit code to null when the
child is killed via signal. This brings the behavior more in
sync with spawn().

Fixes: #11284
PR-URL: #11288
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
child_process Issues and PRs related to the child_process subsystem.
Projects
None yet
Development

No branches or pull requests

3 participants