Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save PatrickPijnappel/f133f7296eb05b966a7bc9486ded35b7 to your computer and use it in GitHub Desktop.
Save PatrickPijnappel/f133f7296eb05b966a7bc9486ded35b7 to your computer and use it in GitHub Desktop.
<unknown>:0: error: fatal error encountered while reading from module 'Foundation'; please file a bug report with your project and the crash log
<unknown>:0: note: compiling as Swift 4.1.50, with 'Foundation' built as Swift 5.3 (this is supported but may expose additional compiler issues)
*** DESERIALIZATION FAILURE (please include this section in any bug report) ***
top-level value not found
Cross-reference to module 'Darwin'
... memcpy
... with type (Optional<UnsafeMutableRawPointer>, Optional<UnsafeRawPointer>, Int) -> Optional<UnsafeMutableRawPointer>
Stack dump:
0. Program arguments: /Users/patrick/Code/swift-source-fork/build/Ninja-Release/swift-macosx-x86_64/bin/swift -frontend -c /Users/patrick/Code/swift-source-fork/swift/benchmark/single-source/IterateData.swift -emit-module-path /Users/patrick/Code/swift-source-fork/build/Ninja-Release/swift-macosx-x86_64/benchmark/O-x86_64-apple-macosx10.9/IterateData.swiftmodule -emit-module-doc-path /Users/patrick/Code/swift-source-fork/build/Ninja-Release/swift-macosx-x86_64/benchmark/O-x86_64-apple-macosx10.9/IterateData.swiftdoc -emit-module-source-info-path /Users/patrick/Code/swift-source-fork/build/Ninja-Release/swift-macosx-x86_64/benchmark/O-x86_64-apple-macosx10.9/IterateData.swiftsourceinfo -target x86_64-apple-macosx10.9 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I /Users/patrick/Code/swift-source-fork/swift/benchmark/utils/ObjectiveCTests -I /Users/patrick/Code/swift-source-fork/swift/benchmark/utils/LibProc -I /Users/patrick/Code/swift-source-fork/build/Ninja-Release/swift-macosx-x86_64/benchmark/O-x86_64-apple-macosx10.9 -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/../../../Developer/Library/Frameworks -g -swift-version 4 -O -Xllvm -align-module-to-page-size -parse-as-library -module-name IterateData -o /Users/patrick/Code/swift-source-fork/build/Ninja-Release/swift-macosx-x86_64/benchmark/O-x86_64-apple-macosx10.9/IterateData.o
1. Swift version 5.3-dev (LLVM bd76300046, Swift b0604c485f)
2. While evaluating request ExecuteSILPipelineRequest(Run pipelines { EarlyModulePasses, HighLevel+EarlyLoopOpt, MidModulePasses+StackPromote, MidLevel, ClosureSpecialize, LowLevel, LateLoopOpt, SIL Debug Info Generator } on SIL for IterateData.IterateData)
3. While running pass #12136 SILModuleTransform "PerformanceSILLinker".
4. While deserializing SIL function "$s10Foundation4DataV13_copyContents12initializingAC8IteratorV_SitSrys5UInt8VG_tFySWXEfU_"
5. While deserializing SIL function "memcpy"
0 swift 0x00000001126c35c8 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1 swift 0x00000001126c2618 llvm::sys::RunSignalHandlers() + 248
2 swift 0x00000001126c3dad SignalHandler(int) + 285
3 libsystem_platform.dylib 0x00007fff6af9242d _sigtramp + 29
4 libsystem_platform.dylib 0x00007ffee1261a70 _sigtramp + 18446744071397242464
5 libsystem_c.dylib 0x00007fff6ae67a1c abort + 120
6 swift 0x000000011272ae90 swift::ModuleFile::finishNormalConformance(swift::NormalProtocolConformance*, unsigned long long) (.cold.1) + 0
7 swift 0x000000010f195cfe swift::ModuleFile::getDecl(llvm::PointerEmbeddedInt<unsigned int, 31>) + 78
8 swift 0x000000010f1ba2f0 swift::SILDeserializer::readSILFunctionChecked(llvm::PointerEmbeddedInt<unsigned int, 31>, swift::SILFunction*, llvm::StringRef, bool, bool) + 1472
9 swift 0x000000010f1b9bcb swift::SILDeserializer::getFuncForReference(llvm::StringRef, swift::SILType) + 491
10 swift 0x000000010f1c6ba4 swift::SILDeserializer::readSILInstruction(swift::SILFunction*, swift::SILBasicBlock*, swift::SILBuilder&, unsigned int, llvm::SmallVectorImpl<unsigned long long>&) + 43780
11 swift 0x000000010f1bb185 swift::SILDeserializer::readSILFunctionChecked(llvm::PointerEmbeddedInt<unsigned int, 31>, swift::SILFunction*, llvm::StringRef, bool, bool) + 5205
12 swift 0x000000010f1c9ab7 swift::SILDeserializer::lookupSILFunction(swift::SILFunction*, bool) + 487
13 swift 0x000000010f240f97 swift::SerializedSILLoader::lookupSILFunction(swift::SILFunction*, bool) + 71
14 swift 0x000000010f2e7a5b swift::SILModule::loadFunction(swift::SILFunction*) + 27
15 swift 0x000000010f27329d swift::SILLinkerVisitor::maybeAddFunctionToWorklist(swift::SILFunction*) + 125
16 swift 0x000000010f2733e3 swift::SILLinkerVisitor::processFunction(swift::SILFunction*) + 227
17 swift 0x000000010f2e7b07 swift::SILModule::linkFunction(swift::SILFunction*, swift::SILModule::LinkingMode) + 103
18 swift 0x000000010f06b569 (anonymous namespace)::SILLinker::run() + 201
19 swift 0x000000010ef75d34 swift::SILPassManager::runModulePass(unsigned int) + 708
20 swift 0x000000010ef7643a swift::SILPassManager::execute() + 394
21 swift 0x000000010ef730b8 swift::SILPassManager::executePassPipelinePlan(swift::SILPassPipelinePlan const&) + 72
22 swift 0x000000010ef73053 swift::ExecuteSILPipelineRequest::evaluate(swift::Evaluator&, swift::SILPipelineExecutionDescriptor) const + 51
23 swift 0x000000010ef8367d swift::SimpleRequest<swift::ExecuteSILPipelineRequest, std::__1::tuple<> (swift::SILPipelineExecutionDescriptor), (swift::CacheKind)0>::evaluateRequest(swift::ExecuteSILPipelineRequest const&, swift::Evaluator&) + 29
24 swift 0x000000010ef78475 llvm::Expected<swift::ExecuteSILPipelineRequest::OutputType> swift::Evaluator::getResultUncached<swift::ExecuteSILPipelineRequest>(swift::ExecuteSILPipelineRequest const&) + 517
25 swift 0x000000010ef731e1 swift::executePassPipelinePlan(swift::SILModule*, swift::SILPassPipelinePlan const&, bool, swift::irgen::IRGenModule*) + 65
26 swift 0x000000010ef7b647 swift::runSILOptimizationPasses(swift::SILModule&) + 151
27 swift 0x000000010eae1a6b swift::CompilerInstance::performSILProcessing(swift::SILModule*) + 651
28 swift 0x000000010ea0d0e9 performCompileStepsPostSILGen(swift::CompilerInstance&, swift::CompilerInvocation const&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule> >, bool, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::PrimarySpecificPaths const&, bool, int&, swift::FrontendObserver*) + 1065
29 swift 0x000000010ea01870 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 14912
30 swift 0x000000010e99a71f main + 815
31 libdyld.dylib 0x00007fff6ad997fd start + 1
32 libdyld.dylib 0x0000000000000022 start + 18446603338723518502
/bin/sh: line 1: 91129 Abort trap: 6 /Users/patrick/Code/swift-source-fork/build/Ninja-Release/swift-macosx-x86_64/bin/swiftc -c -target x86_64-apple-macosx10.9 -O -Xllvm -align-module-to-page-size -g -I /Users/patrick/Code/swift-source-fork/swift/benchmark/utils/ObjectiveCTests -I /Users/patrick/Code/swift-source-fork/swift/benchmark/utils/LibProc -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/../../../Developer/Library/Frameworks -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -no-link-objc-runtime -swift-version 4 -parse-as-library -whole-module-optimization -module-name IterateData -emit-module-path /Users/patrick/Code/swift-source-fork/build/Ninja-Release/swift-macosx-x86_64/benchmark/O-x86_64-apple-macosx10.9/IterateData.swiftmodule -I /Users/patrick/Code/swift-source-fork/build/Ninja-Release/swift-macosx-x86_64/benchmark/O-x86_64-apple-macosx10.9 -o /Users/patrick/Code/swift-source-fork/build/Ninja-Release/swift-macosx-x86_64/benchmark/O-x86_64-apple-macosx10.9/IterateData.o /Users/patrick/Code/swift-source-fork/swift/benchmark/single-source/IterateData.swift
[162/270][ 60%][145.683s] Generating O-x86_64-apple-macosx10.9/IntegerParsing.o
ninja: build stopped: subcommand failed.
ERROR: command terminated with a non-zero exit status 1, aborting
@DavidGoldman
Copy link

Hey, did you figure out how to fix this? I'm running into a similar issue with Swift 5.3 on a locally build Swift toolchain:

<unknown>:0: error: fatal error encountered while reading from module 'Foundation'; please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the project
<unknown>:0: note: module 'Foundation' full misc version is '5.3(5.3)/Apple Swift version 5.3-dev (LLVM 4bae54d8e540ddf, Swift 31f0c5ad1d89aa4)'

*** DESERIALIZATION FAILURE (please include this section in any bug report) ***
top-level value not found
Cross-reference to module 'Darwin'
... memcmp
... with type (UnsafeRawPointer, UnsafeRawPointer, Int) -> Int32

1.      Apple Swift version 5.3-dev (LLVM 4bae54d8e540ddf, Swift 31f0c5ad1d89aa4)
2.      While evaluating request ExecuteSILPipelineRequest(Run pipelines { PrepareOptimizationPasses, EarlyModulePasses, HighLevel,Function+EarlyLoopOpt, HighLevel,Module+StackPromote, Serialize, MidLevel,Function, ClosureSpecialize, LowLevel,Function, LateLoopOpt, SIL Debug Info Generator } on SIL for SwiftProtobuf.SwiftProtobuf)
3.      While running pass #49 SILModuleTransform "PerformanceSILLinker".
4.      While deserializing SIL function "$s10Foundation4DataV2eeoiySbAC_ACtFZSbSWXEfU_"
5.      While deserializing SIL function "memcmp"

@PatrickPijnappel
Copy link
Author

@DavidGoldman I don't quite remember, but I think it might've been related to either an Xcode beta or Swift TensorFlow toolchain being selected…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment