-
Notifications
You must be signed in to change notification settings - Fork 26
Closed
Labels
blockerShow stopping issues for 0.0.1Show stopping issues for 0.0.1bugSomething isn't workingSomething isn't working
Milestone
Description
Describe the bug
A simple call to run
results in "Fatal error: FileDescriptor 3 was not closed" on Windows.
To Reproduce
The following main program:
let _ = try await run(.path(#"C:\tmp\Hello.exe"#))
calls the program "Hello.exe" which has the following code:
print("hello")
Expected behavior
Expected is that Hello.exe
runs, prints "hello" and no error occurs.
Environment:
- Windows 11
- Swift version 6.1.2 (swift-6.1.2-RELEASE), Target: x86_64-unknown-windows-msvc
- swift-subprocess 80bd50f from 2025-06-13
Additional context
It might have something to do with #72.
Metadata
Metadata
Assignees
Labels
blockerShow stopping issues for 0.0.1Show stopping issues for 0.0.1bugSomething isn't workingSomething isn't working
Type
Projects
Relationships
Development
Select code repository
Activity
stefanspringer1 commentedon Jun 15, 2025
Aha, of course the program does not wait. This explains it.
stefanspringer1 commentedon Jun 15, 2025
Hmm... The following code works on macOS (with another path to the executable), but on Windows it outputs the "Fatal error: FileDescriptor 3 was not closed" above.
So there does seem to a problem.
kcieplak commentedon Jun 19, 2025
I am as well seeing the same failure.
The code is simply doing a Subprocess.run and trying to get the status and stdout.
Fix a crash due to improper error handling on Windows
Fix a crash due to improper error handling on Windows
Fix a crash due to improper error handling on Windows (swiftlang#103)