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-8993] Progress bar update crash when running tests in Xcode #4887

Closed
swift-ci opened this issue Oct 14, 2018 · 2 comments
Closed

[SR-8993] Progress bar update crash when running tests in Xcode #4887

swift-ci opened this issue Oct 14, 2018 · 2 comments
Labels

Comments

@swift-ci
Copy link
Contributor

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

Attachment: Download

Environment

MacOS Mojave 10.14
Xcode 10

Additional Detail from JIRA
Votes 0
Component/s Package Manager
Labels Bug
Assignee JhonnyBillM (JIRA)
Priority Medium

md5: 1e198b9064d96c3e663499998bb7ca01

Issue Description:

When running tests in xCode, the ProgressBar test cause the `update(percent:text)` function to crash since `term.width` is `zero` and `prefix.utf8.count` = 3.

Doing a little research:

When getting the `terminalWidth()` in `TerminalController.swift` :

1. `SPMLibc.getenv("COLUMNS")` is returning `nil`
Therefore, we cannot get the term width from the environment.

2. Then, when trying to determine using ioctl, `winSize()` returns `zero`.
[I still need to dig a little deeper into what `ioctl(,,_)` is actually doing], but it is returning `true`, therefore, that function returns `ws_col` which is zero sin winSize is zero.

So, going back to the TerminalController initializer, it does `width = TerminalController.terminalWidth() ?? 80` since TerminalController.terminalWidth() returns zero, not nil, our terminalController width equals zero, and that’s why that’s failing.

@swift-ci
Copy link
Contributor Author

Comment by Jhonny Bill Mena (JIRA)

PR: #1814

@swift-ci
Copy link
Contributor Author

Comment by Jhonny Bill Mena (JIRA)

54a3037

@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

1 participant