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-6952] Investigate serialization of cross-references to private types #49500

Open
belkadan opened this issue Feb 8, 2018 · 1 comment
Open
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself serialization Area → compiler: Serialization & deserialization

Comments

@belkadan
Copy link
Contributor

belkadan commented Feb 8, 2018

Previous ID SR-6952
Radar rdar://problem/37333631
Original Reporter @belkadan
Type Bug
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, Serialization
Assignee @belkadan
Priority Medium

md5: 2b1291b34790aa58e0518e36787cc653

cloned from:

  • SR-6874 Swift 4.1 compiler crash when building release configuration

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 Author

belkadan commented Feb 8, 2018

This bug is to see if we can avoid the cross-references to private types that appeared in the original SR, which would make the fix from there unnecessary.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
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 serialization Area → compiler: Serialization & deserialization
Projects
None yet
Development

No branches or pull requests

1 participant