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-12603] SWIFT_OPTIMIZATION_LEVEL -Osize runtime crash. Xcode 11.4 only #55047

Open
swift-ci opened this issue Apr 15, 2020 · 6 comments
Open
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-12603
Radar rdar://problem/61911131
Original Reporter jlmendezbonini (JIRA User)
Type Bug

Attachment: Download

Environment

Xcode 11.4

MacOS 10.15.4 (19E266)

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee None
Priority Medium

md5: 04af0c47251e9c2b73dd88f92c3a1e25

Issue Description:

To repro, run the tests in the attached project −it has zombies enabled so it'll break every time. However, if you disable zombies run the tests a few times to run into the crash.

This does not reproduce in Xcode 11.3.x and does not happen if SWIFT_OPTIMIZATION_LEVEL is set to either -Onone or -O

@jckarter
Copy link
Member

@swift-ci create

@swift-ci
Copy link
Collaborator Author

Comment by Jorge Mendez (JIRA)

@jckarter any updates on the internal prioritization of this regression? Disabling -Osize translates to a ~1MB binary size regression on our end and it's preventing us from upgrading to Xcode 11.4.

Thanks!

@aschwaighofer
Copy link
Member

Fixed here: #31175

@aschwaighofer
Copy link
Member

You might be able to workaround the issue by marking the function(s) triggering the issue with ``@_optimize(speed)``.

For example in the attached test case

class CrashSwiftOptimizerTests: XCTestCase {
    @_optimize(speed)
    func testOSize() {

@swift-ci
Copy link
Collaborator Author

Comment by Jorge Mendez (JIRA)

aschwaighofer@apple.com (JIRA User) thanks for the workaround. Apart from disabling -Osize entirely, is there another workaround that we can apply globally? Annotating on a per function basis is not truly feasible for us.

@aschwaighofer
Copy link
Member

There is a way to disable a specific pass. The problematic pass is the Outliner: ``-Xllvm -sil-disable-pass=Outliner``. You could try adding this flags under "Other Swift Flags" in the build settings.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself
Projects
None yet
Development

No branches or pull requests

3 participants