Open swift-ci opened 7 years ago
Is your module named "Foundation", or is it referring to the Foundation you've imported? (You're not supposed to use the same names as system modules.)
Comment by Maik Bastian (JIRA)
There is no module named Foundation inside the project. It is referring to an import of Foundation (in some other file in the project).
Comment by Maik Bastian (JIRA)
While trying to find the error of SR-4739 (using a compiler with assertions enabled), I got the following error, which is maybe related to this issue:
*** DESERIALIZATION FAILURE (please include this section in any bug report) ***
result not found
Cross-reference to module 'Foundation'
... NSNotification
... in an extension in module 'Foundation'
... Name
0 swift 0x000000011125bc5c llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 60
1 swift 0x000000011125c1d9 PrintStackTraceSignalHandler(void*) + 25
2 swift 0x0000000111257e89 llvm::sys::RunSignalHandlers() + 425
3 swift 0x000000011125c672 SignalHandler(int) + 354
4 libsystem_platform.dylib 0x00007fff8ca36b3a _sigtramp + 26
5 libsystem_platform.dylib 0x0000000124ad4551 _sigtramp + 2550782513
6 libsystem_c.dylib 0x00007fff8c8bb420 abort + 129
7 swift 0x000000010bd57ef9 swift::ModuleFile::fatal(llvm::Error) + 1161
8 swift 0x000000010bd587a6 swift::ModuleFile::getDecl(llvm::PointerEmbeddedInt<unsigned int, 31>, llvm::Optional<swift::DeclContext*>) + 134
9 swift 0x000000010bd78817 swift::ModuleFile::getTypeChecked(llvm::PointerEmbeddedInt<unsigned int, 31>) + 1431
10 swift 0x000000010bd5a401 swift::ModuleFile::getType(llvm::PointerEmbeddedInt<unsigned int, 31>) + 65
11 swift 0x000000010bd5d142 swift::ModuleFile::getDeclChecked(llvm::PointerEmbeddedInt<unsigned int, 31>, llvm::Optional<swift::DeclContext*>) + 11314
12 swift 0x000000010bd58772 swift::ModuleFile::getDecl(llvm::PointerEmbeddedInt<unsigned int, 31>, llvm::Optional<swift::DeclContext*>) + 82
13 swift 0x000000010bd785eb swift::ModuleFile::getTypeChecked(llvm::PointerEmbeddedInt<unsigned int, 31>) + 875
14 swift 0x000000010bd5a401 swift::ModuleFile::getType(llvm::PointerEmbeddedInt<unsigned int, 31>) + 65
15 swift 0x000000010bd5ea4a swift::ModuleFile::getDeclChecked(llvm::PointerEmbeddedInt<unsigned int, 31>, llvm::Optional<swift::DeclContext*>) + 17722
16 swift 0x000000010bd59184 swift::ModuleFile::readPattern(swift::DeclContext*) + 1876
17 swift 0x000000010bd5945c swift::ModuleFile::readPattern(swift::DeclContext*) + 2604
18 swift 0x000000010bd6026a swift::ModuleFile::getDeclChecked(llvm::PointerEmbeddedInt<unsigned int, 31>, llvm::Optional<swift::DeclContext*>) + 23898
19 swift 0x000000010bd68a1a swift::ModuleFile::readMembers(llvm::SmallVectorImpl<swift::Decl*>&) + 522
20 swift 0x000000010bd7e369 swift::ModuleFile::loadAllMembers(swift::Decl*, unsigned long long) + 217
21 swift 0x000000010c83fb6c swift::IterableDeclContext::loadAllMembers() const + 204
22 swift 0x000000010c804269 swift::NominalTypeDecl::getMembers() const + 25
23 swift 0x000000010c9997ce swift::NominalTypeDecl::lookupDirect(swift::DeclName, bool) + 62
24 swift 0x000000010c9975f9 swift::DeclContext::lookupQualified(swift::Type, swift::DeclName, swift::NLOptions, swift::LazyResolver*, llvm::SmallVectorImpl<swift::ValueDecl*>&) const + 3049
25 swift 0x000000010c4e438a swift::TypeChecker::lookupMemberType(swift::DeclContext*, swift::Type, swift::Identifier, swift::OptionSet<swift::NameLookupFlags, unsigned int>) + 490
26 swift 0x000000010c5e8fd2 resolveNestedIdentTypeComponent(swift::TypeChecker&, swift::DeclContext*, swift::Type, swift::SourceRange, swift::ComponentIdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 2178
27 swift 0x000000010c5e1667 resolveIdentTypeComponent(swift::TypeChecker&, swift::DeclContext*, llvm::ArrayRef<swift::ComponentIdentTypeRepr*>, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 759
28 swift 0x000000010c5e1086 swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 342
29 swift 0x000000010c5e1f27 (anonymous namespace)::TypeResolver::resolveType(swift::TypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>) + 727
30 swift 0x000000010c5e1b69 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 169
31 swift 0x000000010c5dfd8d swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 317
32 swift 0x000000010c60023c bindExtensionDecl(swift::ExtensionDecl*, swift::TypeChecker&) + 316
33 swift 0x000000010c60a4a1 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int)::$_2::operator()(std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*>) const + 609
34 swift 0x000000010c60a235 void llvm::function_ref<void (std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*>)>::callback_fn<swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int)::$_2>(long, std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*>) + 85
35 swift 0x000000010c6883d9 llvm::function_ref<void (std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*>)>::operator()(std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*>) const + 89
36 swift 0x000000010c688366 swift::FileUnit::forAllVisibleModules(llvm::function_ref<void (std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*>)>)::'lambda'(std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*>)::operator()(std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*>) const + 166
37 swift 0x000000010c6882b5 bool llvm::function_ref<bool (std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*>)>::callback_fn<swift::FileUnit::forAllVisibleModules(llvm::function_ref<void (std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*>)>)::'lambda'(std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*>)>(long, std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*>) + 85
38 swift 0x000000010c9811d9 llvm::function_ref<bool (std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*>)>::operator()(std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*>) const + 89
39 swift 0x000000010c95fd24 bool forAllImportedModules<true, llvm::function_ref<bool (std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*>)> >(swift::ModuleDecl*, llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, bool, llvm::function_ref<bool (std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*>)> const&) + 996
40 swift 0x000000010c95f933 swift::ModuleDecl::forAllVisibleModules(llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, bool, llvm::function_ref<bool (std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*>)>) + 83
41 swift 0x000000010c960130 bool swift::ModuleDecl::forAllVisibleModules<llvm::function_ref<bool (std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*>)>&>(llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, llvm::function_ref<bool (std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*>)>&&&) + 96
42 swift 0x000000010c95fe48 swift::FileUnit::forAllVisibleModules(llvm::function_ref<bool (std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*>)>) + 120
43 swift 0x000000010c6881f5 bool swift::FileUnit::forAllVisibleModules<swift::FileUnit::forAllVisibleModules(llvm::function_ref<void (std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*>)>)::'lambda'(std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*>)>(swift::FileUnit::forAllVisibleModules(llvm::function_ref<void (std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*>)>)::'lambda'(std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*>)&&) + 85
44 swift 0x000000010c688094 swift::FileUnit::forAllVisibleModules(llvm::function_ref<void (std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*>)>) + 52
45 swift 0x000000010c602325 bool swift::FileUnit::forAllVisibleModules<swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int)::$_2>(swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int)::$_2&&) + 85
46 swift 0x000000010c601c34 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1092
47 swift 0x000000010ba1acbc swift::CompilerInstance::performSema() + 14460
48 swift 0x000000010a367ae1 performCompile(std::__1::unique_ptr<swift::CompilerInstance, std::__1::default_delete<swift::CompilerInstance> >&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 4961
49 swift 0x000000010a3651be swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 15758
50 swift 0x000000010a298259 main + 4809
51 libdyld.dylib 0x00007fff8c827235 start + 1
And at the bottom:
1. While resolving type Notification.Name at [/Users/Maik/Projectname/NotificationExtensions.swift:12:11 - line:12:24] RangeText="Notification.N"
2. While loading members for 'Notification' in module 'Foundation'
3. While deserializing decl #​3087 (PATTERN_BINDING_DECL) in 'Foundation'
4. While deserializing 'name' (VarDecl #​555) in 'Foundation'
5. While deserializing 'Name' (TypeAliasDecl #​835) in 'Foundation'
The "NotificationExtensions" file contains code of this kind:
extension Notification.Name {
static let somethingHappened = Notification.Name("SomethingHappenedNotification")
}
Environment
Swift snapshot from April 24, 2017 and Xcode 8.3.2Additional Detail from JIRA
| | | |------------------|-----------------| |Votes | 0 | |Component/s | Compiler | |Labels | Bug, CompilerCrash | |Assignee | None | |Priority | Medium | md5: f813901e44f3644c30bf33e5c9d711fcIssue Description:
Compiling with the snapshot from April 24, 2017 the compiler crashes with the following stack trace:
and the following message at the bottom of the log:
I cannot share the project and have not currently found a way to reproduce the issue. Is there something else I could do?