Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-11699] Calling closeFile() on standardInput Pipe before calling Process.run() aborts with EBADF on Linux #3377

Closed
swift-ci opened this issue Nov 2, 2019 · 2 comments
Assignees

Comments

@swift-ci
Copy link
Contributor

swift-ci commented Nov 2, 2019

Previous ID SR-11699
Radar None
Original Reporter Kaiede (JIRA User)
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Environment

First hit on Raspberry Pi w/Raspbian Buster - Swift 5.1.1 RELEASE

Official Swift Docker Container for Linux Also Reproduces It:

  • root@5b62e5c1ca9a:/home/PipeTest# swift --version

  • Swift version 5.1.1 (swift-5.1.1-RELEASE)

  • Target: x86_64-unknown-linux-gnu

Additional Detail from JIRA
Votes 0
Component/s Foundation
Labels Bug
Assignee @spevans
Priority Medium

md5: 6577ae0c207d9cfae623bb7c589a5e6e

relates to:

  • SR-10639 Connecting two Processes with Pipe crashes

Issue Description:

Repro Steps:

  • Unzip PipeTest.zip

  • cd into directory

  • run 'swift test'

Expected:

  • All 4 Tests Pass

Actual

  • testProcess_CrashOnLinux will crash on Linux with EBADF

  • Fatal error: POSIX command failed with error: 9 – EBADF: file /home/buildSwiftOnARM/swift-corelibs-foundation/Foundation/Process.swift, line 825

Compare testProcess_CrashOnLinux with testProcess_WorksOnLinux2. These are functionally the same test, but they close the file handle at different times. Apparently closing the handle before process.run() is called will cause the EBADF on Linux, but not macOS.

@spevans
Copy link
Collaborator

spevans commented Nov 2, 2019

#2553

@beccadax
Copy link
Contributor

beccadax commented Nov 4, 2019

The PR has been merged, so I'm marking this as resolved.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants