mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
In the Android paths of the spawnChild function, the parent was creating a pipe that was never closed, which led to FD starvation. In some tests with a lots of expected crashes, the childs will not spawn anymore since the linker would not have enough descriptors to open the shared libraries, while in other tests which closed the child descriptors as part of the last test, the parent process will hang waiting those descriptors to be closed, which will never had happened. The solution is implement the missing parts of the code, which tried to read from the pipe in the parent side (using select and read, taking pieces from other parts of the code). This should match the fork/execv path used by Android and Haiku to the spawn code used by the rest of the platforms. This change fixes StdlibUnittest/Stdin.swift, stdlib/InputStream.swift.gyb, stdlib/Collection/FlattenCollection.swift.gyb and stdlib/Collection/LazyFilterCollection.swift.gyb, which were the last 4 tests failing in Android AArch64.
14 KiB
14 KiB