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-6874] Swift 4.1 compiler crash when building release configuration #49423

Closed
florianreinhart opened this issue Jan 30, 2018 · 4 comments
Closed

Comments

@florianreinhart
Copy link
Contributor

@florianreinhart florianreinhart commented Jan 30, 2018

Previous ID SR-6874
Radar rdar://problem/37072260
Original Reporter @florianreinhart
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Environment

macOS 10.13.3

Swift 4.1 bundled with Xcode 9.3 beta (9Q98q)

Swift 4.1 Snapshot 2018-01-29 (a)

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, 4.1Regression, CompilerCrash
Assignee @belkadan
Priority Medium

md5: 11e10af5654af37ccc937bf1175df494

cloned to:

  • SR-6952 Investigate serialization of cross-references to private types

Issue Description:

While testing a SPM project with Swift 4.1 I ran into a regression. The compiler crashes when building the release configuration.

<unknown>:0: error: fatal error encountered while reading from module 'CSV'; please file a bug report with your project and the crash log

*** DESERIALIZATION FAILURE (please include this section in any bug report) ***
couldn't decode type
Cross-reference to module 'Foundation'
... CharacterSet
... _storage

0  swift                    0x00000001045f0168 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1  swift                    0x00000001045f0876 SignalHandler(int) + 694
2  libsystem_platform.dylib 0x00007fff74d6cf5a _sigtramp + 26
3  libsystem_platform.dylib 000000000000000000 _sigtramp + 2334732480
4  libsystem_c.dylib        0x00007fff74b97312 abort + 127
5  swift                    0x0000000101f26012 swift::ModuleFile::fatal(llvm::Error) + 706
6  swift                    0x0000000101f26566 swift::ModuleFile::getDecl(llvm::PointerEmbeddedInt<unsigned int, 31>, llvm::Optional<swift::DeclContext*>) + 198
7  swift                    0x0000000101f4cbaf swift::SILDeserializer::readSILInstruction(swift::SILFunction*, swift::SILBasicBlock*, swift::SILBuilder&, unsigned int, llvm::SmallVectorImpl<unsigned long long>&) + 3407
8  swift                    0x0000000101f4a93b swift::SILDeserializer::readSILFunction(llvm::PointerEmbeddedInt<unsigned int, 31>, swift::SILFunction*, llvm::StringRef, bool, bool) + 5195
9  swift                    0x0000000101f5b1e7 swift::SILDeserializer::lookupSILFunction(swift::SILFunction*) + 439
10 swift                    0x0000000101fd4c0b swift::SerializedSILLoader::lookupSILFunction(swift::SILFunction*) + 75
11 swift                    0x0000000101c68f29 swift::SILLinkerVisitor::processFunction(swift::SILFunction*) + 121
12 swift                    0x0000000101ce37a5 swift::SILModule::linkFunction(swift::SILFunction*, swift::SILOptions::LinkingMode) + 117
13 swift                    0x00000001019e1d04 runOnFunctionRecursively(swift::SILFunction*, swift::FullApplySite, swift::SILOptions::LinkingMode, llvm::DenseSet<swift::SILFunction*, llvm::DenseMapInfo<swift::SILFunction*> >&, llvm::ImmutableSet<swift::SILFunction*, llvm::ImutContainerInfo<swift::SILFunction*> >::Factory&, llvm::ImmutableSet<swift::SILFunction*, llvm::ImutContainerInfo<swift::SILFunction*> >, swift::ClassHierarchyAnalysis*) + 3780
14 swift                    0x00000001019e0c88 (anonymous namespace)::MandatoryInlining::run() + 408
15 swift                    0x000000010195a1ab swift::SILPassManager::runModulePass(swift::SILModuleTransform*) + 1355
16 swift                    0x000000010195ad21 swift::SILPassManager::runOneIteration() + 1025
17 swift                    0x000000010120527b swift::SILPassManager::executePassPipelinePlan(swift::SILPassPipelinePlan const&) + 187
18 swift                    0x000000010196357c swift::runSILDiagnosticPasses(swift::SILModule&) + 172
19 swift                    0x00000001010abbbc performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 10684
20 swift                    0x00000001010a8220 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3376
21 swift                    0x0000000101067ac3 main + 3075
22 libdyld.dylib            0x00007fff74aeb115 start + 1

The attached project reproduces the crash.

I am able to reproduce the crash with Swift 4.1 included with Xcode 9.3 beta 1 and also Swift 4.1 Snapshot 2018-01-29 (a).

@belkadan
Copy link
Contributor

@belkadan belkadan commented Jan 31, 2018

@swift-ci create

@belkadan
Copy link
Contributor

@belkadan belkadan commented Feb 2, 2018

This uncovered a nasty hole in our model today. An immediate fix is at #14352

@belkadan
Copy link
Contributor

@belkadan belkadan commented Feb 8, 2018

4.1: #14473
5.0: #14474

@florianreinhart
Copy link
Contributor Author

@florianreinhart florianreinhart commented Feb 9, 2018

Thanks for the quick fix @belkadan. I can confirm that the latest Swift 4.1 Snapshot 2018-02-08 (a) fixes the issue.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants