Title: `subprocess.kill('SIGWINCH')` forcefully terminates subprocesses on Windows · Issue #64324 · nodejs/node · GitHub
Open Graph Title: `subprocess.kill('SIGWINCH')` forcefully terminates subprocesses on Windows · Issue #64324 · nodejs/node
X Title: `subprocess.kill('SIGWINCH')` forcefully terminates subprocesses on Windows · Issue #64324 · nodejs/node
Description: Version Current main by source inspection. This appears to affect releases since #55514. Platform Microsoft Windows. The behavior is in the _WIN32 path in src/process_wrap.cc. Subsystem child_process What steps will reproduce the bug? Ru...
Open Graph Description: Version Current main by source inspection. This appears to affect releases since #55514. Platform Microsoft Windows. The behavior is in the _WIN32 path in src/process_wrap.cc. Subsystem child_proce...
X Description: Version Current main by source inspection. This appears to affect releases since #55514. Platform Microsoft Windows. The behavior is in the _WIN32 path in src/process_wrap.cc. Subsystem child_proce...
Opengraph URL: https://github.com/nodejs/node/issues/64324
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`subprocess.kill('SIGWINCH')` forcefully terminates subprocesses on Windows","articleBody":"### Version\n\nCurrent `main` by source inspection. This appears to affect releases since https://github.com/nodejs/node/pull/55514.\n\n### Platform\n\nMicrosoft Windows. The behavior is in the `_WIN32` path in `src/process_wrap.cc`.\n\n### Subsystem\n\nchild_process\n\n### What steps will reproduce the bug?\n\nRun this on Windows:\n\n```js\n// test.mjs\nimport {spawn} from 'node:child_process';\n\nconst subprocess = spawn(process.execPath, ['-e', 'setInterval(() => {}, 1000)']);\n\nsubprocess.on('error', error => {\n\tconsole.log('error', error.code);\n});\n\nsubprocess.on('exit', (exitCode, signalCode) => {\n\tconsole.log('exit', {exitCode, signalCode});\n});\n\nconsole.log('kill returned:', subprocess.kill('SIGWINCH'));\n\nsetTimeout(() => {\n\tconsole.log('still running:', !subprocess.killed && subprocess.exitCode === undefined && subprocess.signalCode === undefined);\n\tsubprocess.kill('SIGKILL');\n}, 1000);\n```\n\n### How often does it reproduce? Is there a required condition?\n\nAlways on Windows.\n\n### What is the expected behavior? Why is that the expected behavior?\n\n`SIGWINCH` should not forcefully terminate the subprocess on Windows.\n\nBefore https://github.com/nodejs/node/pull/55514, unsupported signals such as `SIGWINCH` reached libuv and returned `UV_ENOSYS`. In JavaScript, `ChildProcess.prototype.kill()` handles `UV_ENOSYS` by throwing an `ErrnoException`.\n\nThat behavior was safer for `SIGWINCH`: it did not terminate the subprocess.\n\n### What do you see instead?\n\nSince https://github.com/nodejs/node/pull/55514, `src/process_wrap.cc` remaps every Windows signal other than `SIGKILL`, `SIGTERM`, `SIGINT`, `SIGQUIT`, and `0` to `SIGKILL` before calling libuv:\n\n```cpp\n#ifdef _WIN32\n if (signal != SIGKILL && signal != SIGTERM && signal != SIGINT &&\n signal != SIGQUIT && signal != 0) {\n signal = SIGKILL;\n }\n#endif\n int err = uv_process_kill(&wrap->process_, signal);\n```\n\nThe current vendored libuv Windows implementation only forcefully terminates for `SIGQUIT`, `SIGTERM`, `SIGKILL`, and `SIGINT`, treats `0` as a health check, and returns `UV_ENOSYS` for unsuported signals:\n\n```c\n default:\n /* Unsupported signal. */\n return UV_ENOSYS;\n```\n\nBecause Node now remaps `SIGWINCH` before libuv sees it, `subprocess.kill('SIGWINCH')` terminates the subprocess as if `SIGKILL` had been sent.\n\nThis is surprising because `SIGWINCH` is not a termination signal. Users forwarding terminal resize notifications can accidentally kill a child process on Windows.\n\n### Additional information\n\nIt was already commented here: https://github.com/nodejs/node/issues/42923#issuecomment-3448792053 but it was ignored.\n\nPossible fix: exempt `SIGWINCH` from the Windows remapping in `src/process_wrap.cc`, so it keeps the previous unsupported-signal behavior instead of becoming `SIGKILL`.\n","author":{"url":"https://github.com/sindresorhus","@type":"Person","name":"sindresorhus"},"datePublished":"2026-07-06T13:39:47Z","url":"https://github.com/nodejs/node/issues/64324"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:d9ec34b1-a8e1-ff43-c623-e826808ebc3a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D6E0:C8434:432885:5700C5:6AED2245 |
| html-safe-nonce | 1f13423e99cbbc35f7ab8721547b60d950f9487dfdc445d387a61dd990d75081 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENkUwOkM4NDM0OjQzMjg4NTo1NzAwQzU6NkFFRDIyNDUiLCJ2aXNpdG9yX2lkIjoiMTkwMTYwMDY1NDc0ODM2MTI4NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 3bded1ccdb2ee95d44ae86a88269695f12fb865137cacd67a2387473dd2af9a6 |
| hovercard-subject-tag | issue:4819694046 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/64324/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a7bc4ae375617c3311bf90f93956fb2cfdd626fbc4b4025854d1c85a3f120856/nodejs/node/issues/64324 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a7bc4ae375617c3311bf90f93956fb2cfdd626fbc4b4025854d1c85a3f120856/nodejs/node/issues/64324 |
| og:image:alt | Version Current main by source inspection. This appears to affect releases since #55514. Platform Microsoft Windows. The behavior is in the _WIN32 path in src/process_wrap.cc. Subsystem child_proce... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sindresorhus |
| hostname | github.com |
| expected-hostname | github.com |
| None | e3e0f7f63e50c6fe879198a93a0a023a648ecc0a5e9bc3b5e033ac57172237e6 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 707a24b346ac8a82878b9c084efaa38a997660cb |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width