You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
VSCode 1.54.1 breaks spawned processes with cwd option #118267
A few of our extensions are failing to start because spawned shell script processes do not work
Does this issue occur when all extensions are disabled?: No
We run a few extensions (including an LSP server) which essentially spawn an external process executing shell wrapper scripts and attempts to manipulate its standard IO.
Since upgrading to 1.54.1 we have noticed a strange behavior where when writing to the external process stdin we get EBADF error. This seems specifically to only occur when attempting to execute shell script directly as when we modify the spawn (or similar functions) to invoke the script via bash directly it works fine.
This is illustrated by the following test cases executed while debugging VSCode:
This turned out to be a bug in the posix_spawnp implementation where a relative executable path will cause it to successfully launch the program, but erroneously return ENOENT when used with posix_spawn_file_actions_addchdir_np because of the stat call performed on the executable path after the child process is launched. Ref: https://opensource.apple.com/source/Libc/Libc-1439.40.11/sys/posix_spawn.c.auto.html
Have resorted to use pthread_chdir_np instead to respect the cwd option, will update here once the updated runtime is available.
Reacted by Jérémie Laval, John Vilk and Benjamin Pasero
Robo (@deepak1556) thanks for figuring it out! I just tested with the latest insiders version (version info below) and I can confirm that our workloads are now properly working again!
Activity
chore: bump electron@11.3.0
chore: bump electron@11.3.0 (#118680)
deepak1556 commentedon Mar 11, 2021
We just released an update to VS Code Insiders that has a fix for this issue. Please try it out and let us know.
35 remaining items
deepak1556 commentedon May 12, 2021
This turned out to be a bug in the
posix_spawnpimplementation where a relative executable path will cause it to successfully launch the program, but erroneously returnENOENTwhen used withposix_spawn_file_actions_addchdir_npbecause of the stat call performed on the executable path after the child process is launched. Ref: https://opensource.apple.com/source/Libc/Libc-1439.40.11/sys/posix_spawn.c.auto.htmlHave resorted to use
pthread_chdir_npinstead to respect the cwd option, will update here once the updated runtime is available.jeremie-stripe commentedon May 14, 2021
Robo (@deepak1556) thanks for figuring it out! I just tested with the latest insiders version (version info below) and I can confirm that our workloads are now properly working again!
chore: bump electron@12.0.7
chore: bump electron@12.0.7
chore: bump electron@12.0.5
chore: bump electron@12.0.7