Created attachment 1622
Script that reproduces the problem
In OSX, the implementation of the C function read() as well as the C function fileno() will invoke flockfile on the given argument. The function `spawnProcessImpl` from the `std.process` module tries to extract the fileno from the three File that are passed (stdin, stdout and stderr), if one of this files is busy doing read() in another thread, then the subprocess will not be launched until the read() is fulfilled and the file is unlocked.
Attached is a simple code that demonstrates the issue. A read in stdin is done in the main thread, while a secondary thread tries to execute a ls. Due to the bug, the ls result will be available only after the user inputs a line in the stdin.
Comment #1 by bugzilla — 2020-01-05T16:09:38Z
Just for reference: On linux (debian) this works.
Comment #2 by robert.schadek — 2024-12-01T16:28:16Z