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-5038] Swift 4 compiler crash #47614

Closed
swift-ci opened this issue May 28, 2017 · 6 comments
Closed

[SR-5038] Swift 4 compiler crash #47614

swift-ci opened this issue May 28, 2017 · 6 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software regression serialization Area → compiler: Serialization & deserialization swift 4.0

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-5038
Radar rdar://problem/32488971
Original Reporter swiftlyfalling (JIRA User)
Type Bug
Status Resolved
Resolution Done
Environment
  • Xcode 8.3.2 (8E2002)

  • Toolchain: Swift 4.0 Snapshot 2017-05-24 (a)

  • macOS 10.12.5

Additional Detail from JIRA
Votes 1
Component/s Compiler
Labels Bug, 4.0Regression, CompilerCrash, Serialization
Assignee None
Priority Medium

md5: 58b62d30ac0940f2ac47769959386d15

Issue Description:

The Swift 4.0 compiler (2017-05-24-a) crashes when compiling the following code that works with the Swift 3.x compiler:

Reduced Repro Case:

class Base { }
class BaseSubclass: Base { }

func test() {
    class TestClass<T: Base> { } // Causes Swift 4.0 compiler crash
    let _ = TestClass<BaseSubclass>()
}

Steps to Reproduce:

  1. Attempt to compile the code above with the Swift 4.0 snapshot specified.

Result:

  1. Compilation fails with error:

Command failed due to signal: Abort trap: 6
...
Assertion failed: ((DWARFMangling || type->isCanonical()) && "expecting canonical types when not mangling for the debugger"), function appendType, file /Users/buildnode/jenkins/workspace/oss-swift-4.0-package-osx/swift/lib/AST/ASTMangler.cpp, line 581.

Result with Swift 3.x:

  1. Compilation succeeds.

Swift 4.0 workaround:
Moving the

class TestClass<T: Base> { }

line outside of the test() function resolves the crash.

@belkadan
Copy link
Contributor

@adrian-prantl, look familiar?

@adrian-prantl
Copy link
Member

No, but looking at the assertion this may not actually be debug info related. I'll try and reproduce.

@belkadan
Copy link
Contributor

For sure. It doesn't reproduce without -g, though, so I wonder what debugging is tickling.

…oh, it's in serialization. Sorry!

@belkadan
Copy link
Contributor

@swift-ci create

@belkadan
Copy link
Contributor

belkadan commented Jun 1, 2017

#10022

@ematejska
Copy link
Mannequin

ematejska mannequin commented Aug 1, 2017

The pull request mentioned by Jordan is merged and this seems to resolved from trying it with the latest 4.0 toolchain (7/31).

@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 in itself crash Bug: A crash, i.e., an abnormal termination of software regression serialization Area → compiler: Serialization & deserialization swift 4.0
Projects
None yet
Development

No branches or pull requests

4 participants