spawn
with stdio/stdin 'pipe' options causes pwsh shell to hang after execution
#52364
Labels
child_process
Issues and PRs related to the child_process subsystem.
Version
v21.7.1
Platform
Linux *** 5.15.146.1-microsoft-standard-WSL2 #1 SMP Thu Jan 11 04:09:03 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
child_process
What steps will reproduce the bug?
To reproduce the issue, spawn pwsh with stdin configured with 'pipe':
When ran, the pwsh is launched and hang. There is no data output on console and a strace show pwsh waiting on a futex.
Terminal output:
After a kill of the pwsh process (through
kill
command):Terminal output:
How often does it reproduce? Is there a required condition?
Issue can be consistently reproduced when stdin is configured with
pipe
.What is the expected behavior? Why is that the expected behavior?
pwsh should exit after execution, but for some reason when stdin is configured with
pipe
, the shell doesn't exit.I cannot reproduce this issue outside of node (when launching pwsh from /bin/sh for example).
What do you see instead?
pwsh doesn't exit after the execution of the script.
It needs to be killed to trigger the
close
callback.Additional information
The issue doesn't appear if stdin is configured with
inherit
.In this case, pwsh close after executing the command as expected:
Terminal output:
The text was updated successfully, but these errors were encountered: