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-11449] SIL Crash when referencing XCTestError #53850

Closed
swift-ci opened this issue Sep 11, 2019 · 3 comments
Closed

[SR-11449] SIL Crash when referencing XCTestError #53850

swift-ci opened this issue Sep 11, 2019 · 3 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 swift 5.1

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-11449
Radar rdar://problem/55263075
Original Reporter dlbuckley (JIRA User)
Type Bug
Status Closed
Resolution Duplicate

Attachment: Download

Environment

MacBook Pro (15-inch, 2018) - macOS 10.14.6 (18G87)

Xcode 11 GM - (11A419c)

iOS 13

Swift 5.1

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

md5: 12e019f26fc0a1f72c47994c49892485

Issue Description:

While migrating to iOS 13 with Xcode 11 GM (11A419c) I found that my tests wouldn't even build due to to the following Swift compiler error:

top-level value not found
Cross-reference to module 'XCTest'
... XCTestErrorDomain
... with type String


Stack dump:
0.  Program arguments: /Users/dale/Downloads/Xcode 11 GM.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -merge-modules -emit-module /Users/dale/Library/Developer/Xcode/DerivedData/SwiftTestsCrash-hlbvrescgslfdsahjiktgmnqlqkg/Build/Intermediates.noindex/SwiftTestsCrash.build/Debug-iphonesimulator/SwiftTestsCrashTests.build/Objects-normal/x86_64/SwiftTestsCrashTests~partial.swiftmodule -parse-as-library -sil-merge-partial-modules -disable-diagnostic-passes -disable-sil-perf-optzns -target x86_64-apple-ios13.0-simulator -enable-objc-interop -sdk /Users/dale/Downloads/Xcode 11 GM.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.0.sdk -I /Users/dale/Library/Developer/Xcode/DerivedData/SwiftTestsCrash-hlbvrescgslfdsahjiktgmnqlqkg/Build/Products/Debug-iphonesimulator -I /Users/dale/Downloads/Xcode 11 GM.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/lib -F /Users/dale/Library/Developer/Xcode/DerivedData/SwiftTestsCrash-hlbvrescgslfdsahjiktgmnqlqkg/Build/Products/Debug-iphonesimulator -F /Users/dale/Downloads/Xcode 11 GM.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks -enable-testing -g -module-cache-path /Users/dale/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -swift-version 5 -enforce-exclusivity=checked -Onone -D DEBUG -serialize-debugging-options -serialize-debugging-options -Xcc -working-directory -Xcc /Users/dale/Desktop/SwiftTestsCrash -enable-anonymous-context-mangled-names -Xcc -I/Users/dale/Library/Developer/Xcode/DerivedData/SwiftTestsCrash-hlbvrescgslfdsahjiktgmnqlqkg/Build/Intermediates.noindex/SwiftTestsCrash.build/Debug-iphonesimulator/SwiftTestsCrashTests.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/dale/Library/Developer/Xcode/DerivedData/SwiftTestsCrash-hlbvrescgslfdsahjiktgmnqlqkg/Build/Intermediates.noindex/SwiftTestsCrash.build/Debug-iphonesimulator/SwiftTestsCrashTests.build/SwiftTestsCrashTests-generated-files.hmap -Xcc -I/Users/dale/Library/Developer/Xcode/DerivedData/SwiftTestsCrash-hlbvrescgslfdsahjiktgmnqlqkg/Build/Intermediates.noindex/SwiftTestsCrash.build/Debug-iphonesimulator/SwiftTestsCrashTests.build/SwiftTestsCrashTests-own-target-headers.hmap -Xcc -I/Users/dale/Library/Developer/Xcode/DerivedData/SwiftTestsCrash-hlbvrescgslfdsahjiktgmnqlqkg/Build/Intermediates.noindex/SwiftTestsCrash.build/Debug-iphonesimulator/SwiftTestsCrashTests.build/SwiftTestsCrashTests-all-target-headers.hmap -Xcc -iquote -Xcc /Users/dale/Library/Developer/Xcode/DerivedData/SwiftTestsCrash-hlbvrescgslfdsahjiktgmnqlqkg/Build/Intermediates.noindex/SwiftTestsCrash.build/Debug-iphonesimulator/SwiftTestsCrashTests.build/SwiftTestsCrashTests-project-headers.hmap -Xcc -I/Users/dale/Library/Developer/Xcode/DerivedData/SwiftTestsCrash-hlbvrescgslfdsahjiktgmnqlqkg/Build/Products/Debug-iphonesimulator/include -Xcc -I/Users/dale/Library/Developer/Xcode/DerivedData/SwiftTestsCrash-hlbvrescgslfdsahjiktgmnqlqkg/Build/Intermediates.noindex/SwiftTestsCrash.build/Debug-iphonesimulator/SwiftTestsCrashTests.build/DerivedSources-normal/x86_64 -Xcc -I/Users/dale/Library/Developer/Xcode/DerivedData/SwiftTestsCrash-hlbvrescgslfdsahjiktgmnqlqkg/Build/Intermediates.noindex/SwiftTestsCrash.build/Debug-iphonesimulator/SwiftTestsCrashTests.build/DerivedSources/x86_64 -Xcc -I/Users/dale/Library/Developer/Xcode/DerivedData/SwiftTestsCrash-hlbvrescgslfdsahjiktgmnqlqkg/Build/Intermediates.noindex/SwiftTestsCrash.build/Debug-iphonesimulator/SwiftTestsCrashTests.build/DerivedSources -Xcc -DDEBUG=1 -emit-module-doc-path /Users/dale/Library/Developer/Xcode/DerivedData/SwiftTestsCrash-hlbvrescgslfdsahjiktgmnqlqkg/Build/Intermediates.noindex/SwiftTestsCrash.build/Debug-iphonesimulator/SwiftTestsCrashTests.build/Objects-normal/x86_64/SwiftTestsCrashTests.swiftdoc -emit-objc-header-path /Users/dale/Library/Developer/Xcode/DerivedData/SwiftTestsCrash-hlbvrescgslfdsahjiktgmnqlqkg/Build/Intermediates.noindex/SwiftTestsCrash.build/Debug-iphonesimulator/SwiftTestsCrashTests.build/Objects-normal/x86_64/SwiftTestsCrashTests-Swift.h -module-name SwiftTestsCrashTests -o /Users/dale/Library/Developer/Xcode/DerivedData/SwiftTestsCrash-hlbvrescgslfdsahjiktgmnqlqkg/Build/Intermediates.noindex/SwiftTestsCrash.build/Debug-iphonesimulator/SwiftTestsCrashTests.build/Objects-normal/x86_64/SwiftTestsCrashTests.swiftmodule 
1.  While deserializing SIL function "$sSC15XCTestErrorCodeLeV11errorDomainSSvgZ"
2.  While deserializing SIL global "XCTestErrorDomain"
0  swift                    0x000000010fc1aeb3 PrintStackTraceSignalHandler(void*) + 51
1  swift                    0x000000010fc1a686 SignalHandler(int) + 358
2  libsystem_platform.dylib 0x00007fff7bd41b5d _sigtramp + 29
3  swift                    0x0000000110612000 (anonymous namespace)::DarwinX86AsmBackend::getCompactUnwindRegNum(unsigned int) const::CU32BitRegs + 117488
4  libsystem_c.dylib        0x00007fff7bbfb6a6 abort + 127
5  swift                    0x000000010c47d354 swift::ModuleFile::fatal(llvm::Error) + 1828
6  swift                    0x000000010c4b4aba swift::SILDeserializer::readGlobalVar(llvm::StringRef) + 1850
7  swift                    0x000000010c4aeb07 swift::SILDeserializer::readSILInstruction(swift::SILFunction*, swift::SILBasicBlock*, swift::SILBuilder&, unsigned int, llvm::SmallVectorImpl<unsigned long long>&) + 39367
8  swift                    0x000000010c4a445f swift::SILDeserializer::readSILFunctionChecked(llvm::PointerEmbeddedInt<unsigned int, 31>, swift::SILFunction*, llvm::StringRef, bool, bool) + 8303
9  swift                    0x000000010c4b6b45 swift::SILDeserializer::getAllSILFunctions() + 1349
10 swift                    0x000000010c53def4 swift::SerializedSILLoader::getAllForModule(swift::Identifier, swift::FileUnit*) + 180
11 swift                    0x000000010bb76033 swift::CompilerInstance::performSILProcessing(swift::SILModule*, swift::UnifiedStatsReporter*) + 147
12 swift                    0x000000010b871cc5 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 33925
13 swift                    0x000000010b866034 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 6820
14 swift                    0x000000010b7f35a3 main + 1219
15 libdyld.dylib            0x00007fff7bb563d5 start + 1
16 libdyld.dylib            0x0000000000000047 start + 2219482227
error: Abort trap: 6 (in target 'SwiftTestsCrashTests' from project 'SwiftTestsCrash')

Simply creating an XCTestError in Swift causes the issue. Removing this line allowed the compiler to continue and build successfully.

XCTestError(.timeoutWhileWaiting)

I have included a test project that reproduces the issue. Once open in Xcode, run the tests to reproduce the crash.

@belkadan
Copy link
Contributor

@swift-ci create

@xymus
Copy link
Contributor

xymus commented Feb 7, 2020

Hi Dale, thank you for the report and reproducer. This issue should now be fixed in Swift 5.2. Can you try to use the Xcode 11.4 beta, or a 5.2 toolchain from https://swift.org/download/#snapshots, and let us know if it is resolved?

@xymus
Copy link
Contributor

xymus commented Apr 6, 2020

Closing as this should be fixed in Xcode 11.4.

dlbuckley (JIRA User), please reopen this issue if you still see it in your project.

@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 swift 5.1
Projects
None yet
Development

No branches or pull requests

4 participants