Description
Describe the bug
Process.currentDirectoryURL
is implemented on top of chdir in swift-corelibs-foundation. As a result, using multiple, unrelated Process
objects from multiple threads in Linux that have this property set can cause wildly unexpected outcomes, leaving the working directory of the current process and all child processes set essentially randomly.
To Reproduce
Steps to reproduce the behavior:
- Call Process from multiple threads at once with different
currentDirectoryURL
values
...
Expected behavior
All child processes execute in the expected directory and the parent working directory is unchanged