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-2703] Investigate SwiftPM CI popen failure #5213

Closed
ankitspd opened this issue Sep 20, 2016 · 11 comments
Closed

[SR-2703] Investigate SwiftPM CI popen failure #5213

ankitspd opened this issue Sep 20, 2016 · 11 comments
Labels

Comments

@ankitspd
Copy link
Member

Previous ID SR-2703
Radar rdar://problem/28411803
Original Reporter @aciidb0mb3r
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Package Manager
Labels Bug
Assignee None
Priority Medium

md5: cb318fd28fca62a433c67935148682c3

relates to:

Issue Description:

This test seems to failing a lot recently on CI for unknown reason.

Test Case 'ShellTests.testPopen' started at 03:31:05.715
fatal error: 'try!' expression unexpectedly raised an error: POSIX.ShellError.popen(["echo", "foo"], read error: Bad file descriptor (9))

https://ci.swift.org/job/oss-swift-package-linux-ubuntu-15_10/2138/console

@ankitspd
Copy link
Member Author

I tried looking around but couldn't reproduce this issue on my Ubuntu 14.04 vm
@ddunbar Any ideas?

@ankitspd
Copy link
Member Author

Another failure spotted here: https://ci.swift.org/job/swift-PR-Linux/3867/console

@abertelrud
Copy link
Contributor

I have looked into this a bit, since I was hitting it on Ubuntu 10.04. It only seems to happen when running the unit tests from `Utilities/bootstrap test`, not when just running the test from the command-line. I'm going to take another look at what the differences there are.

@abertelrud
Copy link
Contributor

So, invoking `swift-test` in exactly the same manner as the bootstrap script does (`env SWIFT_EXEC=/home/user/swiftpm/.build/debug/swiftc SWIFT_BUILD_PATH=/home/user/swiftpm/.build /home/user/swiftpm/.build/debug/swift-test -Xlinker -rpath -Xlinker $ORIGIN/../lib/swift/linux`) does reproduce the problem. However, adding the test specifier flag (`-s UtilityTests.ShellTests`) doesn't trigger the bug. Only when running all the tests.

@abertelrud
Copy link
Contributor

More data as I figure things out.

@abertelrud
Copy link
Contributor

Also (perhaps unsurprisingly) the -Xlinker flags aren't relevant.

@abertelrud
Copy link
Contributor

But removing all the tests except the `UtilityTests` does trigger the error.

@abertelrud
Copy link
Contributor

Looks like the problem is with `ProgressBarTests`. If it runs before `ShellTests`, then the failure occurs. Otherwise not.

@abertelrud
Copy link
Contributor

Oh of course: that code is messing with pseudo terminals etc.

@ankitspd
Copy link
Member Author

Thanks @abertelrud for investigation, I was able to produce this locally after installing a fresh copy of Ubuntu
I have pushed a fix here #679

@abertelrud
Copy link
Contributor

Fantastic. Thank you for the fix! We should try to get this into the next Swift bugfix release.

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

No branches or pull requests

2 participants