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-4981] CoreStore source breakage: While deserializing extension of '<null>' (ExtensionDecl #5) in 'CoreStore' #47558
Comments
This is happening in 4.0. |
@swift-ci create |
Comment by John Estropia (JIRA) Hi, I am the author of CoreStore. Is there any way to work around this from the library's side? I'm getting this same error with Swift 3.2 as well on Xcode 9: 0 swift 0x000000011217d3aa PrintStackTraceSignalHandler(void*) + 42
1 swift 0x000000011217c7e6 SignalHandler(int) + 662
2 libsystem_platform.dylib 0x00007fffa518bb3a _sigtramp + 26
3 libsystem_platform.dylib 0x00007fa55dd09490 _sigtramp + 3099056496
4 libsystem_c.dylib 0x00007fffa5010420 abort + 129
5 swift 0x000000010f8aad1a swift::ModuleFile::readConformance(llvm::BitstreamCursor&, swift::GenericEnvironment*) + 4042
6 swift 0x000000010f8aab75 swift::ModuleFile::readConformance(llvm::BitstreamCursor&, swift::GenericEnvironment*) + 3621
7 swift 0x000000010f8ad5cc swift::ModuleFile::loadAllConformances(swift::Decl const*, unsigned long long, llvm::SmallVectorImpl<swift::ProtocolConformance*>&) + 300
8 swift 0x000000010fcdcecd swift::ConformanceLookupTable::updateLookupTable(swift::NominalTypeDecl*, swift::ConformanceLookupTable::ConformanceStage, swift::LazyResolver*) + 2029
9 swift 0x000000010fcdc7d7 swift::ConformanceLookupTable::updateLookupTable(swift::NominalTypeDecl*, swift::ConformanceLookupTable::ConformanceStage, swift::LazyResolver*) + 247
10 swift 0x000000010fce0a51 swift::ConformanceLookupTable::lookupConformance(swift::ModuleDecl*, swift::NominalTypeDecl*, swift::ProtocolDecl*, swift::LazyResolver*, llvm::SmallVectorImpl<swift::ProtocolConformance*>&) + 49
11 swift 0x000000010fd3e300 swift::ModuleDecl::lookupConformance(swift::Type, swift::ProtocolDecl*, swift::LazyResolver*) + 1248
12 swift 0x000000010f9af930 swift::ClangImporter::Implementation::finishPendingActions() + 1808
13 swift 0x000000010f984d80 swift::ClangImporter::Implementation::importDeclAndCacheImpl(clang::NamedDecl const*, swift::importer::ImportNameVersion, bool) + 2816
14 swift 0x000000010f96944f swift::ClangImporter::Implementation::lookupValue(swift::SwiftLookupTable&, swift::DeclName, swift::VisibleDeclConsumer&) + 591
15 swift 0x000000010f965966 swift::ClangModuleUnit::lookupValue(llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::DeclName, swift::NLKind, llvm::SmallVectorImpl<swift::ValueDecl*>&) const + 566
16 swift 0x000000010fd4526d void lookupInModule<llvm::SmallSet<swift::CanType, 4u, (anonymous namespace)::SortCanType>, swift::namelookup::lookupInModule(swift::ModuleDecl*, llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::DeclName, llvm::SmallVectorImpl<swift::ValueDecl*>&, swift::NLKind, swift::namelookup::ResolutionKind, swift::LazyResolver*, swift::DeclContext const*, llvm::ArrayRef<std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*> >)::$_0>(swift::ModuleDecl*, llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, llvm::SmallVectorImpl<swift::ValueDecl*>&, swift::namelookup::ResolutionKind, bool, swift::LazyResolver*, llvm::SmallDenseMap<std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*>, llvm::TinyPtrVector<swift::ValueDecl*>, 32u, llvm::DenseMapInfo<std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*> >, llvm::detail::DenseMapPair<std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*>, llvm::TinyPtrVector<swift::ValueDecl*> > >&, swift::DeclContext const*, bool, llvm::ArrayRef<std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*> >, swift::namelookup::lookupInModule(swift::ModuleDecl*, llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::DeclName, llvm::SmallVectorImpl<swift::ValueDecl*>&, swift::NLKind, swift::namelookup::ResolutionKind, swift::LazyResolver*, swift::DeclContext const*, llvm::ArrayRef<std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*> >)::$_0) + 333
17 swift 0x000000010fd45874 void lookupInModule<llvm::SmallSet<swift::CanType, 4u, (anonymous namespace)::SortCanType>, swift::namelookup::lookupInModule(swift::ModuleDecl*, llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::DeclName, llvm::SmallVectorImpl<swift::ValueDecl*>&, swift::NLKind, swift::namelookup::ResolutionKind, swift::LazyResolver*, swift::DeclContext const*, llvm::ArrayRef<std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*> >)::$_0>(swift::ModuleDecl*, llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, llvm::SmallVectorImpl<swift::ValueDecl*>&, swift::namelookup::ResolutionKind, bool, swift::LazyResolver*, llvm::SmallDenseMap<std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*>, llvm::TinyPtrVector<swift::ValueDecl*>, 32u, llvm::DenseMapInfo<std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*> >, llvm::detail::DenseMapPair<std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*>, llvm::TinyPtrVector<swift::ValueDecl*> > >&, swift::DeclContext const*, bool, llvm::ArrayRef<std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*> >, swift::namelookup::lookupInModule(swift::ModuleDecl*, llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::DeclName, llvm::SmallVectorImpl<swift::ValueDecl*>&, swift::NLKind, swift::namelookup::ResolutionKind, swift::LazyResolver*, swift::DeclContext const*, llvm::ArrayRef<std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*> >)::$_0) + 1876
18 swift 0x000000010fd450e3 swift::namelookup::lookupInModule(swift::ModuleDecl*, llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::DeclName, llvm::SmallVectorImpl<swift::ValueDecl*>&, swift::NLKind, swift::namelookup::ResolutionKind, swift::LazyResolver*, swift::DeclContext const*, llvm::ArrayRef<std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*> >) + 1267
19 swift 0x000000010fd4dece swift::DeclContext::lookupQualified(swift::Type, swift::DeclName, swift::NLOptions, swift::LazyResolver*, llvm::SmallVectorImpl<swift::ValueDecl*>&) const + 1438
20 swift 0x000000010f8a5caa swift::ModuleFile::resolveCrossReference(swift::ModuleDecl*, unsigned int) + 874
21 swift 0x000000010f897d65 swift::ModuleFile::getDeclChecked(llvm::PointerEmbeddedInt<unsigned int, 31>, llvm::Optional<swift::DeclContext*>) + 14853
22 swift 0x000000010f8a1a4d swift::ModuleFile::getTypeChecked(llvm::PointerEmbeddedInt<unsigned int, 31>) + 4237
23 swift 0x000000010f89904c swift::ModuleFile::getDeclChecked(llvm::PointerEmbeddedInt<unsigned int, 31>, llvm::Optional<swift::DeclContext*>) + 19692
24 swift 0x000000010f894324 swift::ModuleFile::getDecl(llvm::PointerEmbeddedInt<unsigned int, 31>, llvm::Optional<swift::DeclContext*>) + 84
25 swift 0x000000010f8cda7a swift::ModuleFile::getTopLevelDecls(llvm::SmallVectorImpl<swift::Decl*>&) + 2714
26 swift 0x000000010f57c680 swift::SILPassManager::SILPassManager(swift::SILModule*, llvm::StringRef) + 1504
27 swift 0x000000010f582cff swift::runSILDiagnosticPasses(swift::SILModule&) + 143
28 swift 0x000000010eb4f0f0 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 13696
29 swift 0x000000010eb4a304 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 7332
30 swift 0x000000010eb00728 main + 12248
31 libdyld.dylib 0x00007fffa4f7c235 start + 1
32 libdyld.dylib 0x0000000000000042 start + 1527266830
Stack dump:
0. Program arguments: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -emit-module -filelist /var/folders/bv/hvtc52bn1mgcfg6j6368nzx80000gp/T/inputs-abe3f0 -parse-as-library -target x86_64-apple-ios8.0 -enable-objc-interop -sdk /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk -I /Users/JohnEstropia/Documents/XCodeProjects/CoreStore/DerivedData/Build/Products/Debug-iphonesimulator -F /Users/JohnEstropia/Documents/XCodeProjects/CoreStore/DerivedData/Build/Products/Debug-iphonesimulator -application-extension -enable-testing -g -import-underlying-module -module-cache-path /Users/JohnEstropia/Documents/XCodeProjects/CoreStore/DerivedData/ModuleCache -swift-version 3 -D DEBUG -serialize-debugging-options -Xcc -I/Users/JohnEstropia/Documents/XCodeProjects/CoreStore/DerivedData/Build/Intermediates/CoreStore.build/Debug-iphonesimulator/CoreStore iOS.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/JohnEstropia/Documents/XCodeProjects/CoreStore/DerivedData/Build/Intermediates/CoreStore.build/Debug-iphonesimulator/CoreStore iOS.build/CoreStore-generated-files.hmap -Xcc -I/Users/JohnEstropia/Documents/XCodeProjects/CoreStore/DerivedData/Build/Intermediates/CoreStore.build/Debug-iphonesimulator/CoreStore iOS.build/CoreStore-own-target-headers.hmap -Xcc -I/Users/JohnEstropia/Documents/XCodeProjects/CoreStore/DerivedData/Build/Intermediates/CoreStore.build/Debug-iphonesimulator/CoreStore iOS.build/CoreStore-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc /Users/JohnEstropia/Documents/XCodeProjects/CoreStore/DerivedData/Build/Intermediates/CoreStore.build/all-product-headers.yaml -Xcc -iquote -Xcc /Users/JohnEstropia/Documents/XCodeProjects/CoreStore/DerivedData/Build/Intermediates/CoreStore.build/Debug-iphonesimulator/CoreStore iOS.build/CoreStore-project-headers.hmap -Xcc -I/Users/JohnEstropia/Documents/XCodeProjects/CoreStore/DerivedData/Build/Products/Debug-iphonesimulator/include -Xcc -I/Users/JohnEstropia/Documents/XCodeProjects/CoreStore/DerivedData/Build/Intermediates/CoreStore.build/Debug-iphonesimulator/CoreStore iOS.build/DerivedSources/x86_64 -Xcc -I/Users/JohnEstropia/Documents/XCodeProjects/CoreStore/DerivedData/Build/Intermediates/CoreStore.build/Debug-iphonesimulator/CoreStore iOS.build/DerivedSources -Xcc -DDEBUG=1 -Xcc -ivfsoverlay -Xcc /Users/JohnEstropia/Documents/XCodeProjects/CoreStore/DerivedData/Build/Intermediates/CoreStore.build/Debug-iphonesimulator/CoreStore iOS.build/unextended-module-overlay.yaml -Xcc -working-directory/Users/JohnEstropia/Documents/XCodeProjects/CoreStore -emit-module-doc-path /Users/JohnEstropia/Documents/XCodeProjects/CoreStore/DerivedData/Build/Intermediates/CoreStore.build/Debug-iphonesimulator/CoreStore iOS.build/Objects-normal/x86_64/CoreStore.swiftdoc -module-name CoreStore -emit-objc-header-path /Users/JohnEstropia/Documents/XCodeProjects/CoreStore/DerivedData/Build/Intermediates/CoreStore.build/Debug-iphonesimulator/CoreStore iOS.build/Objects-normal/x86_64/CoreStore-Swift.h -o /Users/JohnEstropia/Documents/XCodeProjects/CoreStore/DerivedData/Build/Intermediates/CoreStore.build/Debug-iphonesimulator/CoreStore iOS.build/Objects-normal/x86_64/CoreStore.swiftmodule
1. While reading from /Users/JohnEstropia/Documents/XCodeProjects/CoreStore/DerivedData/Build/Intermediates/CoreStore.build/Debug-iphonesimulator/CoreStore iOS.build/Objects-normal/x86_64/CoreDataNativeType~partial.swiftmodule
2. While deserializing extension of '<null>' (ExtensionDecl #​10) in 'CoreStore'
3. While deserializing decl #​20 (XREF) in 'CoreStore'
4. Cross-reference to module 'Foundation'
... NSNull
5. /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSNull.h:9:12: importing 'NSNull'
6. While loading conformances for extension of NSNull in module 'CoreStore'
7. While reading conformance for type 'NSNull'
8. While ... to 'QueryableAttributeType' in module 'CoreStore'
9. While cross-referencing conformance for 'NSNull' in module 'Foundation'
10. While ... to 'CoreDataNativeType' in module 'CoreStore'
11. If you're seeing a crash here, check that your SDK and dependencies are at least as new as the versions used to build 'CoreStore' |
Comment by John Estropia (JIRA) Sorry, forgot to mention this is on CoreStore's prototype/Swift_3_2 branch. |
Ah, this is the issue I mentioned in the pull request, John—trying to make one associated type extend another. Removing that will make the crash go away. |
Comment by John Estropia (JIRA) I see what you mean now, thanks! |
The core team has decided that this qualifies as a bug fix to now reject invalid code and will not be downgraded to a warning in Swift 3 mode. @lplarson, what happens next? |
PR testing passed. The issue is resolved. |
Additional Detail from JIRA
md5: 577544b610c6fe55048d551e72c05b53
Issue Description:
To reproduce:
To build Swift from scratch before testing:
4. $ ./reproduce.py master --project-path CoreStore
Or if you've already built Swift:
4. $ ./reproduce.py master --project-path CoreStore --swiftc path/to/swiftc
The text was updated successfully, but these errors were encountered: