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-6130] Compiles without -g but crashes compiler with -g #48685

Closed
jepers opened this issue Oct 12, 2017 · 5 comments
Closed

[SR-6130] Compiles without -g but crashes compiler with -g #48685

jepers opened this issue Oct 12, 2017 · 5 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 serialization Area → compiler: Serialization & deserialization

Comments

@jepers
Copy link

jepers commented Oct 12, 2017

Previous ID SR-6130
Radar rdar://problem/34956549
Original Reporter @jepers
Type Bug
Status Closed
Resolution Done

Attachment: Download

Environment

macOS 10.13, Xcode 9 beta 1, toolchain dev snapshot 2017-10-10

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

md5: c91c0f342de00d82dae614d02a38040f

Issue Description:

I noticed this issue in a project within Xcode 9 beta 1 using toolchain development-snapshot-2017-10-10 (won't work / fail for other reasons with prior versions, so please try this with 2017-10-10 or later).

The attached swift files are a reduced version of my original project, and it can probably be further reduced by someone more skilled than me.

The attached files can be compiled successfully like this, note without -g:
$ /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2017-10-10-a.xctoolchain/usr/bin/swiftc main.swift BasicBitPattern.swift VectorIndex.swift Vector.swift StandardVectorTypes.swift

And the resulting executable runs and work as expected:
$ ./main
Vector1<Float>(e0: 0.100000001)

However, the compiler crashes when using -g:
$ /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2017-10-10-a.xctoolchain/usr/bin/swiftc -g main.swift BasicBitPattern.swift VectorIndex.swift Vector.swift StandardVectorTypes.swift && ./main
Assertion failed: (resolver && "Unable to resolve type witness"), function getTypeWitnessAndDecl, file /Users/buildnode/jenkins/workspace/oss-swift-package-osx/swift/lib/AST/ProtocolConformance.cpp, line 470.
snip

See attached crash log.

(
I don't know if it's worth mentioning that I didn't download and install
swift-DEVELOPMENT-SNAPSHOT-2017-10-10-a-osx-symbols.pkg
only
swift-DEVELOPMENT-SNAPSHOT-2017-10-10-a-osx.pkg
I have installed and used lots of snapshots and never installed the symbols pkg, so I guess I should have run into similar issues before if that had anything to do with it.
EDIT: I've now installed the symbols pkg, restarted Xcode and tried compiling the original project, but it didn't matter, ie the result is the same: Compiles with build configuration Release, but crashes compiler with Debug.
)

@belkadan
Copy link
Contributor

Crashing in generic signature building during deserialization because it's expecting a live type-checker.

@swift-ci create

@jepers
Copy link
Author

jepers commented Oct 13, 2017

This issue seems to have been fixed in dev snapshot 2017-10-12.

@jepers
Copy link
Author

jepers commented Oct 26, 2017

Not sure if I'm doing things right but I've set this issue to resolved since the issue can't be reproduced with more recent snapshots.

@belkadan
Copy link
Contributor

That's fine. I wonder what got fixed in that two-day window, though. It's nice to have something we can point to.

@jepers
Copy link
Author

jepers commented Dec 5, 2017

Perhaps related to https://bugs.swift.org/browse/SR-6522 in some way?

@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 serialization Area → compiler: Serialization & deserialization
Projects
None yet
Development

No branches or pull requests

3 participants