Skip to content

[SR-2745] Simple Swift 3.0 UIView subclass crashes compiler when archiving #45349

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

Closed
swift-ci opened this issue Sep 23, 2016 · 4 comments
Closed
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler itself crash Bug: A crash, i.e., an abnormal termination of software optimized only Flag: An issue whose reproduction requires optimized compilation

Comments

@swift-ci
Copy link
Contributor

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

Attachment: Download

Environment

Xcode 8.0 on macOS 10.12 (16A319) on a MacBook Pro. The selected hardware device is my iPhone 5S running iOS 10.0.1 (14A403).

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, CompilerCrash, OptimizedOnly
Assignee @adrian-prantl
Priority Medium

md5: 245c8d6adad0c69fac2ac1917c108c23

Issue Description:

The following simple Swift 3.0 subclass of a UIView crashes the compiler when archiving:

class MyView: UIView {
    
    required init?(coder: NSCoder) {
        return nil
    }
    
}

Steps to Reproduce:

  1. Open the attached sample project.
  2. Select "Archive" from the "Product" menu within Xcode.

Expected Results:
I expect the code to compile.

Actual Results

I get this compilation error:

Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1

If I comment out the class declaration above, I can create a build archive.

I can build and run the app on my device, but when I archive it I get this crash.

@belkadan
Copy link
Contributor

The main difference between "Archive" and "Run" is optimizations. @bob-wilson, who should look at this?

@bob-wilson
Copy link
Contributor

I reproduced this. The error is:

inlinable function call in a function with debug info must have a !dbg location
%11 = call %swift.type* @_TMaC14UIViewSubclass6MyView() #6
LLVM ERROR: Broken function found, compilation aborted!

I think Adrian just fixed this: #5001

@adrian-prantl
Copy link
Contributor

Yes, that's the exact same testcase in the PR5001 :-)

@adrian-prantl
Copy link
Contributor

This was resolved by #5001

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added the crash Bug: A crash, i.e., an abnormal termination of software label Dec 12, 2022
This issue was closed.
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 itself crash Bug: A crash, i.e., an abnormal termination of software optimized only Flag: An issue whose reproduction requires optimized compilation
Projects
None yet
Development

No branches or pull requests

5 participants