[SR-6130] Compiles without -g but crashes compiler with -g #48685
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
Attachment: Download
Environment
macOS 10.13, Xcode 9 beta 1, toolchain dev snapshot 2017-10-10
Additional Detail from JIRA
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.
)
The text was updated successfully, but these errors were encountered: