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-7322] DESERIALIZATION FAILURE #49870
Comments
Comment by Doug Russell (JIRA) The build isn't expected to succeed because Foo doesn't conform to EventHandler, but it's failing without producing a useful diagnostic. |
Comment by Doug Russell (JIRA) Added Temp.zip as a more concise reproduction. This is a build failure from a TOT debug build of swift: ➜ Temp swift -Xswiftc "-target" -Xswiftc "x86_64-apple-macosx10.13" *** DESERIALIZATION FAILURE (please include this section in any bug report) ***
|
Comment by Doug Russell (JIRA) was able to get a more useful error from a debug build of the compiler. I even reproduced the identical error with the original code this was a reduction of. ➜ Temp /Users/doug/Source/Swift/build/Ninja-DebugAssert/swiftpm-macosx-x86_64/x86_64-apple-macosx10.10/debug/swift-build -Xswiftc "-target" -Xswiftc "x86_64-apple-macosx10.13" Compile Swift Module 'AccessibilityElement' (64 sources) Assertion failed: (wT->isDeclaration() && "Our witness table at this point must be a " "declaration."), function readWitnessTable, file /Users/doug/Source/Swift/swift/lib/Serialization/DeserializeSIL.cpp, line 2806. 0 swift 0x0000000115dbb38c llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 60 1 swift 0x0000000115dbb989 PrintStackTraceSignalHandler(void*) + 25 2 swift 0x0000000115db7059 llvm::sys::RunSignalHandlers() + 425 3 swift 0x0000000115dbbd22 SignalHandler(int) + 354 4 libsystem_platform.dylib 0x00007fff648e9f5a _sigtramp + 26 5 swift 0x000000011741ceb0 cmark_strbuf__initbuf + 2257995 6 libsystem_c.dylib 0x00007fff646871ae abort + 127 7 libsystem_c.dylib 0x00007fff6464f1ac basename_r + 0 8 swift 0x000000010ff89db9 swift::SILDeserializer::readWitnessTable(llvm::PointerEmbeddedInt<unsigned int, 31>, swift::SILWitnessTable*) + 1785 9 swift 0x000000010ff8b77a swift::SILDeserializer::getAllWitnessTables() + 170 10 swift 0x00000001100af46c swift::SILDeserializer::getAll(bool) + 108 11 swift 0x00000001100af73b swift::SerializedSILLoader::getAllForModule(swift::Identifier, swift::FileUnit*) + 683 12 swift 0x000000010f8a1e17 swift::SILModule::linkAllFromCurrentModule() + 71 13 swift 0x000000010da93f87 performMandatorySILPasses(swift::CompilerInvocation&, swift::SILModule*, swift::FrontendObserver*) + 215 14 swift 0x000000010da7cdc0 performCompileStepsPostSILGen(swift::CompilerInstance&, swift::CompilerInvocation&, std::__1::unique_ptr<swift::SILModule, std::__1::default_deleteswift::SILModule >, bool, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::PrimarySpecificPaths const&, bool, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 2784 15 swift 0x000000010da6eb0e performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 4030 16 swift 0x000000010da6bf5e swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 5086 17 swift 0x000000010d999475 main + 4837 18 libdyld.dylib 0x00007fff645db015 start + 1 19 libdyld.dylib 0x0000000000000067 start + 2611105875 Stack dump:
:0: error: unable to execute command: Abort trap: 6 :0: error: merge-module command failed due to signal 6 (use -v to see invocation) error: terminated(1): /Users/doug/Source/Swift/build/Ninja-DebugAssert/swiftpm-macosx-x86_64/x86_64-apple-macosx10.10/debug/swift-build-tool -f /Users/doug/Desktop/Temp/.build/debug.yaml main output: ➜ Temp |
Comment by Doug Russell (JIRA) added some logging in readWitnessTable() and as getAllWitnessTables() is iterating and reading all the witness tables, the one that asserts seems to be the first one in the getAllWitnessTables loop to have an existing witness table and not just make a new one. |
Comment by Doug Russell (JIRA) Seems like an earlier iteration of getAllWitnessTables() is causing the witness table to be created and then converted to a definition DECODER RING: start void swift::SILDeserializer::getAllWitnessTables():2911:0x7fdac9875a00 void swift::SILWitnessTable::addWitnessTable():38:0x7fdac8ca57d0 void swift::SILWitnessTable::addWitnessTable():38:0x7fdac8ca5830 void swift::SILWitnessTable::addWitnessTable():38:0x7fdac8ca5890 void swift::SILWitnessTable::addWitnessTable():38:0x7fdac8ca5910 void swift::SILWitnessTable::addWitnessTable():38:0x7fdac8ca59d0 void swift::SILWitnessTable::addWitnessTable():38:0x7fdac8ca5ab0 void swift::SILWitnessTable::addWitnessTable():38:0x7fdac8ca5b70 void swift::SILWitnessTable::addWitnessTable():38:0x7fdac8ca5c70 void swift::SILWitnessTable::addWitnessTable():38:0x7fdac8ca5cf0 void swift::SILWitnessTable::addWitnessTable():38:0x7fdac8cac000 void swift::SILWitnessTable::addWitnessTable():38:0x7fdac8cac100 end void swift::SILDeserializer::getAllWitnessTables():2917:0x7fdac9875a00 start void swift::SILDeserializer::getAllWitnessTables():2911:0x7fdac9876600 void swift::SILWitnessTable::addWitnessTable():38:0x7fdac9249370 void swift::SILWitnessTable::addWitnessTable():38:0x7fdac92493f0 void swift::SILWitnessTable::addWitnessTable():38:0x7fdac92494b0 void swift::SILWitnessTable::addWitnessTable():38:0x7fdac9249590 void swift::SILWitnessTable::addWitnessTable():38:0x7fdac9249910 void swift::SILWitnessTable::addWitnessTable():38:0x7fdac9249b30 void swift::SILWitnessTable::addWitnessTable():38:0x7fdac9249bd0 void swift::SILWitnessTable::addWitnessTable():38:0x7fdac9249c50 void swift::SILWitnessTable::addWitnessTable():38:0x7fdac9249d10 void swift::SILWitnessTable::addWitnessTable():38:0x7fdac9249d90 void swift::SILWitnessTable::addWitnessTable():38:0x7fdac9249e10 existing 0x7fdac8ca5ab0
|
Comment by Doug Russell (JIRA) This is the problem witness table: sil_witness_table shared [serialized] NSAccessibilityRole: RawRepresentable module AppKit { NSAccessibilityRole is used for a couple methods on a protocol (AnyElement) that is an associated type for EventHandler |
@swift-ci create |
The deserialization crash should be fixed by https://github.com/apple/swift/pull/15764/commits/52c390d26a7def564aee3affcc8488f1f16a7139, which is in the 4.2 and master branches now and should show up in snapshots soon. Can you try a new snapshot when they come out? |
rustle (JIRA User), Could you verify if the problem is fixed and if so move the JIRA to "Closed"? |
Attachment: Download
Additional Detail from JIRA
md5: 1fdfc650d1e411b04f38c5866cc7e2c3
Issue Description:
Run swift build in AccessibilityElement folder to checkout dependencies
Run Test.workspace and build with Test All scheme
Build Failure:
:0: error: fatal error encountered while reading from module 'AccessibilityElement'; please file a bug report with your project and the crash log
*** DESERIALIZATION FAILURE (please include this section in any bug report) ***
(see "While..." info below)
0 swift 0x000000010b1fcffa PrintStackTraceSignalHandler(void*) + 42
1 swift 0x000000010b1fc3b6 SignalHandler(int) + 966
2 libsystem_platform.dylib 0x00007fff648e9f5a _sigtramp + 26
3 libsystem_platform.dylib 0x000000011a94b558 _sigtramp + 3053852184
4 libsystem_c.dylib 0x00007fff646871ae abort + 127
5 swift 0x000000010892abae swift::ModuleFile::fatal(llvm::Error) + 2062
6 swift 0x000000010893cdce swift::ModuleFile::getTypeChecked(llvm::PointerEmbeddedInt<unsigned int, 31>) + 12958
7 swift 0x000000010893a853 swift::ModuleFile::getTypeChecked(llvm::PointerEmbeddedInt<unsigned int, 31>) + 3363
8 swift 0x0000000108932a74 swift::ModuleFile::getDeclCheckedImpl(llvm::PointerEmbeddedInt<unsigned int, 31>, llvm::Optionalswift::DeclContext\*) + 30980
9 swift 0x000000010892b03f swift::ModuleFile::getDeclChecked(llvm::PointerEmbeddedInt<unsigned int, 31>, llvm::Optionalswift::DeclContext\*) + 79
10 swift 0x000000010893a7a3 swift::ModuleFile::getTypeChecked(llvm::PointerEmbeddedInt<unsigned int, 31>) + 3187
11 swift 0x000000010892e253 swift::ModuleFile::getDeclCheckedImpl(llvm::PointerEmbeddedInt<unsigned int, 31>, llvm::Optionalswift::DeclContext\*) + 12515
12 swift 0x000000010892b03f swift::ModuleFile::getDeclChecked(llvm::PointerEmbeddedInt<unsigned int, 31>, llvm::Optionalswift::DeclContext\*) + 79
13 swift 0x000000010893f200 swift::ModuleFile::readPattern(swift::DeclContext*) + 448
14 swift 0x000000010893f614 swift::ModuleFile::readPattern(swift::DeclContext*) + 1492
15 swift 0x0000000108936fd0 swift::ModuleFile::getDeclCheckedImpl(llvm::PointerEmbeddedInt<unsigned int, 31>, llvm::Optionalswift::DeclContext\*) + 48736
16 swift 0x000000010892b03f swift::ModuleFile::getDeclChecked(llvm::PointerEmbeddedInt<unsigned int, 31>, llvm::Optionalswift::DeclContext\*) + 79
17 swift 0x0000000108944d44 swift::ModuleFile::loadAllMembers(swift::Decl*, unsigned long long) + 916
18 swift 0x0000000108be08ef swift::IterableDeclContext::loadAllMembers() const + 207
19 swift 0x00000001088ccd2a swift::MultiConformanceChecker::checkAllConformances() + 4922
20 swift 0x00000001088e1c27 swift::TypeChecker::checkConformancesInContext(swift::DeclContext*, swift::IterableDeclContext*) + 4391
21 swift 0x0000000108888f9f (anonymous namespace)::DeclChecker::visit(swift::Decl*) + 3279
22 swift 0x0000000108925a42 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int, unsigned int, unsigned int) + 1954
23 swift 0x00000001085a7cfd swift::CompilerInstance::performSema() + 6301
24 swift 0x0000000107854054 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 1892
25 swift 0x0000000107851e64 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 7908
26 swift 0x00000001078068b5 main + 18917
27 libdyld.dylib 0x00007fff645db015 start + 1
Stack dump:
Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -primary-file /Users/doug/Desktop/Test/Test/Test/AppDelegate.swift -target x86_64-apple-macosx10.13 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -I /Users/doug/Library/Developer/Xcode/DerivedData/Test-gwypgihpzpicnmexephdfucctrdv/Build/Products/Debug -F /Users/doug/Library/Developer/Xcode/DerivedData/Test-gwypgihpzpicnmexephdfucctrdv/Build/Products/Debug -enable-testing -g -module-cache-path /Users/doug/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -swift-version 4 -enforce-exclusivity=checked -Onone -D DEBUG -serialize-debugging-options -Xcc -I/Users/doug/Library/Developer/Xcode/DerivedData/Test-gwypgihpzpicnmexephdfucctrdv/Build/Intermediates.noindex/Test.build/Debug/Test.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/doug/Library/Developer/Xcode/DerivedData/Test-gwypgihpzpicnmexephdfucctrdv/Build/Intermediates.noindex/Test.build/Debug/Test.build/Test-generated-files.hmap -Xcc -I/Users/doug/Library/Developer/Xcode/DerivedData/Test-gwypgihpzpicnmexephdfucctrdv/Build/Intermediates.noindex/Test.build/Debug/Test.build/Test-own-target-headers.hmap -Xcc -I/Users/doug/Library/Developer/Xcode/DerivedData/Test-gwypgihpzpicnmexephdfucctrdv/Build/Intermediates.noindex/Test.build/Debug/Test.build/Test-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc /Users/doug/Library/Developer/Xcode/DerivedData/Test-gwypgihpzpicnmexephdfucctrdv/Build/Intermediates.noindex/Test.build/all-product-headers.yaml -Xcc -iquote -Xcc /Users/doug/Library/Developer/Xcode/DerivedData/Test-gwypgihpzpicnmexephdfucctrdv/Build/Intermediates.noindex/Test.build/Debug/Test.build/Test-project-headers.hmap -Xcc -I/Users/doug/Library/Developer/Xcode/DerivedData/Test-gwypgihpzpicnmexephdfucctrdv/Build/Products/Debug/include -Xcc -I/Users/doug/Library/Developer/Xcode/DerivedData/Test-gwypgihpzpicnmexephdfucctrdv/Build/Intermediates.noindex/Test.build/Debug/Test.build/DerivedSources/x86_64 -Xcc -I/Users/doug/Library/Developer/Xcode/DerivedData/Test-gwypgihpzpicnmexephdfucctrdv/Build/Intermediates.noindex/Test.build/Debug/Test.build/DerivedSources -Xcc -DDEBUG=1 -Xcc -working-directory/Users/doug/Desktop/Test/Test -emit-module-doc-path /Users/doug/Library/Developer/Xcode/DerivedData/Test-gwypgihpzpicnmexephdfucctrdv/Build/Intermediates.noindex/Test.build/Debug/Test.build/Objects-normal/x86_64/AppDelegate
partial.swiftdoc -serialize-diagnostics-path /Users/doug/Library/Developer/Xcode/DerivedData/Test-gwypgihpzpicnmexephdfucctrdv/Build/Intermediates.noindex/Test.build/Debug/Test.build/Objects-normal/x86_64/AppDelegate.dia -parse-as-library -module-name Test -emit-module-path /Users/doug/Library/Developer/Xcode/DerivedData/Test-gwypgihpzpicnmexephdfucctrdv/Build/Intermediates.noindex/Test.build/Debug/Test.build/Objects-normal/x86_64/AppDelegatepartial.swiftmodule -emit-dependencies-path /Users/doug/Library/Developer/Xcode/DerivedData/Test-gwypgihpzpicnmexephdfucctrdv/Build/Intermediates.noindex/Test.build/Debug/Test.build/Objects-normal/x86_64/AppDelegate.d -emit-reference-dependencies-path /Users/doug/Library/Developer/Xcode/DerivedData/Test-gwypgihpzpicnmexephdfucctrdv/Build/Intermediates.noindex/Test.build/Debug/Test.build/Objects-normal/x86_64/AppDelegate.swiftdeps -o /Users/doug/Library/Developer/Xcode/DerivedData/Test-gwypgihpzpicnmexephdfucctrdv/Build/Intermediates.noindex/Test.build/Debug/Test.build/Objects-normal/x86_64/AppDelegate.o -index-store-path /Users/doug/Library/Developer/Xcode/DerivedData/Test-gwypgihpzpicnmexephdfucctrdv/Index/DataStore -index-system-modulesWhile type-checking 'Foo' at /Users/doug/Desktop/Test/Test/Test/AppDelegate.swift:23:1
While loading members for 'EventHandler' in module 'AccessibilityElement'
While deserializing decl #1670 (PATTERN_BINDING_DECL) in 'AccessibilityElement'
While deserializing decl #1509 (VAR_DECL) in 'AccessibilityElement'
While deserializing 'Controller' (ClassDecl #201) in 'AccessibilityElement'
The text was updated successfully, but these errors were encountered: