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-7483] Deserialization Failure #50026

Closed
stephencelis opened this issue Apr 19, 2018 · 14 comments
Closed

[SR-7483] Deserialization Failure #50026

stephencelis opened this issue Apr 19, 2018 · 14 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software serialization Area → compiler: Serialization & deserialization

Comments

@stephencelis
Copy link
Contributor

Previous ID SR-7483
Radar rdar://problem/39598696
Original Reporter @stephencelis
Type Bug
Status Closed
Resolution Done
Environment

Xcode 9.3 / Swift 4.1

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, CompilerCrash, Serialization
Assignee @belkadan
Priority Medium

md5: e4c5953f19d4e73d593105a489bb43b8

relates to:

  • SR-1393 [SwiftPM] Enforce Swift module import dependencies

Issue Description:

These lines crash the compiler pretty hard!

https://github.com/pointfreeco/swift-prelude/compare/either-trap-6

<unknown>:0: error: fatal error encountered while reading from module 'Either'; please file a bug report with your project and the crash log

*** DESERIALIZATION FAILURE (please include this section in any bug report) ***
top-level value not found
Cross-reference to module 'Prelude'
... Alt

0  swift                    0x00000001075eaffa PrintStackTraceSignalHandler(void*) + 42
1  swift                    0x00000001075ea3b6 SignalHandler(int) + 966
2  libsystem_platform.dylib 0x00007fff6ebe2f5a _sigtramp + 26
3  libsystem_platform.dylib 000000000000000000 _sigtramp + 2437009600
4  libsystem_c.dylib        0x00007fff6e9801ae abort + 127
5  swift                    0x0000000104d18bae swift::ModuleFile::fatal(llvm::Error) + 2062
6  swift                    0x0000000104d2684c swift::ModuleFile::getDeclCheckedImpl(llvm::PointerEmbeddedInt<unsigned int, 31>, llvm::Optional<swift::DeclContext*>) + 55004
7  swift                    0x0000000104d1903f swift::ModuleFile::getDeclChecked(llvm::PointerEmbeddedInt<unsigned int, 31>, llvm::Optional<swift::DeclContext*>) + 79
8  swift                    0x0000000104ddd227 swift::SerializedModuleLoader::loadExtensions(swift::NominalTypeDecl*, unsigned int) + 2295
9  swift                    0x0000000104fb21bf swift::ConformanceLookupTable::updateLookupTable(swift::NominalTypeDecl*, swift::ConformanceLookupTable::ConformanceStage, swift::LazyResolver*) + 1407
10 swift                    0x0000000104fb1d37 swift::ConformanceLookupTable::updateLookupTable(swift::NominalTypeDecl*, swift::ConformanceLookupTable::ConformanceStage, swift::LazyResolver*) + 247
11 swift                    0x0000000105044ba9 swift::NominalTypeDecl::lookupConformance(swift::ModuleDecl*, swift::ProtocolDecl*, llvm::SmallVectorImpl<swift::ProtocolConformance*>&) const + 169
12 swift                    0x0000000105025fae swift::ModuleDecl::lookupConformance(swift::Type, swift::ProtocolDecl*) + 910
13 swift                    0x0000000104cbdd13 swift::TypeChecker::conformsToProtocol(swift::Type, swift::ProtocolDecl*, swift::DeclContext*, swift::OptionSet<swift::ConformanceCheckFlags, unsigned int>, swift::SourceLoc) + 115
14 swift                    0x0000000104cce27d swift::TypeChecker::conformsToProtocol(swift::Type, swift::ProtocolDecl*, swift::DeclContext*, swift::OptionSet<swift::ConformanceCheckFlags, unsigned int>, swift::SourceLoc, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 557
15 swift                    0x0000000104d010d6 swift::TypeChecker::applyUnboundGenericArguments(swift::UnboundGenericType*, swift::GenericTypeDecl*, swift::SourceLoc, swift::DeclContext*, llvm::MutableArrayRef<swift::TypeLoc>, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 1974
16 swift                    0x0000000104d0030b swift::TypeChecker::applyGenericArguments(swift::Type, swift::TypeDecl*, swift::SourceLoc, swift::DeclContext*, swift::GenericIdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 1659
17 swift                    0x0000000104d0d9a0 resolveTypeDecl(swift::TypeChecker&, swift::TypeDecl*, swift::SourceLoc, swift::DeclContext*, swift::DeclContext*, swift::GenericIdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 416
18 swift                    0x0000000104d09c6b resolveTopLevelIdentTypeComponent(swift::TypeChecker&, swift::DeclContext*, swift::ComponentIdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 2027
19 swift                    0x0000000104d08ff1 resolveIdentTypeComponent(swift::TypeChecker&, swift::DeclContext*, llvm::ArrayRef<swift::ComponentIdentTypeRepr*>, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 433
20 swift                    0x0000000104d05f3a swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 122
21 swift                    0x0000000104d013a3 (anonymous namespace)::TypeResolver::resolveType(swift::TypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>) + 243
22 swift                    0x0000000104d0081a swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 362
23 swift                    0x0000000104d00ae9 swift::TypeChecker::applyUnboundGenericArguments(swift::UnboundGenericType*, swift::GenericTypeDecl*, swift::SourceLoc, swift::DeclContext*, llvm::MutableArrayRef<swift::TypeLoc>, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 457
24 swift                    0x0000000104d0030b swift::TypeChecker::applyGenericArguments(swift::Type, swift::TypeDecl*, swift::SourceLoc, swift::DeclContext*, swift::GenericIdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 1659
25 swift                    0x0000000104d0d9a0 resolveTypeDecl(swift::TypeChecker&, swift::TypeDecl*, swift::SourceLoc, swift::DeclContext*, swift::DeclContext*, swift::GenericIdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 416
26 swift                    0x0000000104d09c6b resolveTopLevelIdentTypeComponent(swift::TypeChecker&, swift::DeclContext*, swift::ComponentIdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 2027
27 swift                    0x0000000104d08ff1 resolveIdentTypeComponent(swift::TypeChecker&, swift::DeclContext*, llvm::ArrayRef<swift::ComponentIdentTypeRepr*>, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 433
28 swift                    0x0000000104d05f3a swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 122
29 swift                    0x0000000104d013a3 (anonymous namespace)::TypeResolver::resolveType(swift::TypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>) + 243
30 swift                    0x0000000104d0081a swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 362
31 swift                    0x0000000104ca3b5a checkGenericFuncSignature(swift::TypeChecker&, swift::GenericSignatureBuilder*, swift::AbstractFunctionDecl*, swift::GenericTypeResolver&) + 458
32 swift                    0x0000000104ca3927 swift::TypeChecker::validateGenericFuncSignature(swift::AbstractFunctionDecl*) + 1431
33 swift                    0x0000000104c81c79 (anonymous namespace)::DeclChecker::visitFuncDecl(swift::FuncDecl*) + 4937
34 swift                    0x0000000104c7719c (anonymous namespace)::DeclChecker::visit(swift::Decl*) + 3788
35 swift                    0x0000000104c7931b (anonymous namespace)::DeclChecker::visit(swift::Decl*) + 12363
36 swift                    0x0000000104d13952 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int, unsigned int, unsigned int) + 1714
37 swift                    0x0000000104995cfd swift::CompilerInstance::performSema() + 6301
38 swift                    0x0000000103c42054 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 1892
39 swift                    0x0000000103c3fe64 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 7908
40 swift                    0x0000000103bf48b5 main + 18917
41 libdyld.dylib            0x00007fff6e8d4015 start + 1
Stack dump:
0.  Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c /Users/stephen/Developer/pointfreeco/swift-prelude/Sources/Prelude/Alt.swift /Users/stephen/Developer/pointfreeco/swift-prelude/Sources/Prelude/Array.swift /Users/stephen/Developer/pointfreeco/swift-prelude/Sources/Prelude/Collection.swift /Users/stephen/Developer/pointfreeco/swift-prelude/Sources/Prelude/CommutativeRing.swift /Users/stephen/Developer/pointfreeco/swift-prelude/Sources/Prelude/Comparable.swift /Users/stephen/Developer/pointfreeco/swift-prelude/Sources/Prelude/Comparator.swift /Users/stephen/Developer/pointfreeco/swift-prelude/Sources/Prelude/Curry.swift /Users/stephen/Developer/pointfreeco/swift-prelude/Sources/Prelude/Endo.swift /Users/stephen/Developer/pointfreeco/swift-prelude/Sources/Prelude/Equatable.swift /Users/stephen/Developer/pointfreeco/swift-prelude/Sources/Prelude/EuclideanRing.swift /Users/stephen/Developer/pointfreeco/swift-prelude/Sources/Prelude/Field.swift /Users/stephen/Developer/pointfreeco/swift-prelude/Sources/Prelude/Filterable.swift /Users/stephen/Developer/pointfreeco/swift-prelude/Sources/Prelude/FreeNearSemiring.swift /Users/stephen/Developer/pointfreeco/swift-prelude/Sources/Prelude/Func.swift /Users/stephen/Developer/pointfreeco/swift-prelude/Sources/Prelude/Function.swift /Users/stephen/Developer/pointfreeco/swift-prelude/Sources/Prelude/HeytingAlgebra.swift /Users/stephen/Developer/pointfreeco/swift-prelude/Sources/Prelude/Hole.swift -primary-file /Users/stephen/Developer/pointfreeco/swift-prelude/Sources/Prelude/IO.swift /Users/stephen/Developer/pointfreeco/swift-prelude/Sources/Prelude/KeyPath.swift /Users/stephen/Developer/pointfreeco/swift-prelude/Sources/Prelude/Monoid.swift /Users/stephen/Developer/pointfreeco/swift-prelude/Sources/Prelude/NearSemiring.swift /Users/stephen/Developer/pointfreeco/swift-prelude/Sources/Prelude/Never.swift /Users/stephen/Developer/pointfreeco/swift-prelude/Sources/Prelude/Operators.swift /Users/stephen/Developer/pointfreeco/swift-prelude/Sources/Prelude/Optional.swift /Users/stephen/Developer/pointfreeco/swift-prelude/Sources/Prelude/Parallel.swift /Users/stephen/Developer/pointfreeco/swift-prelude/Sources/Prelude/Plus.swift /Users/stephen/Developer/pointfreeco/swift-prelude/Sources/Prelude/PrecedenceGroups.swift /Users/stephen/Developer/pointfreeco/swift-prelude/Sources/Prelude/Ring.swift /Users/stephen/Developer/pointfreeco/swift-prelude/Sources/Prelude/Semigroup.swift /Users/stephen/Developer/pointfreeco/swift-prelude/Sources/Prelude/Semiring.swift /Users/stephen/Developer/pointfreeco/swift-prelude/Sources/Prelude/Sequence.swift /Users/stephen/Developer/pointfreeco/swift-prelude/Sources/Prelude/Set.swift /Users/stephen/Developer/pointfreeco/swift-prelude/Sources/Prelude/String.swift /Users/stephen/Developer/pointfreeco/swift-prelude/Sources/Prelude/Strong.swift /Users/stephen/Developer/pointfreeco/swift-prelude/Sources/Prelude/Tagged.swift /Users/stephen/Developer/pointfreeco/swift-prelude/Sources/Prelude/Tuple.swift /Users/stephen/Developer/pointfreeco/swift-prelude/Sources/Prelude/Unit.swift -target x86_64-apple-macosx10.10 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -I /Users/stephen/Library/Developer/Xcode/DerivedData/Prelude-awcxhttffdukcidokfxfgfitwhjz/Build/Products/Debug -F /Users/stephen/Library/Developer/Xcode/DerivedData/Prelude-awcxhttffdukcidokfxfgfitwhjz/Build/Products/Debug -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -enable-testing -g -module-cache-path /Users/stephen/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -swift-version 4 -enforce-exclusivity=checked -Onone -D SWIFT_PACKAGE -D Xcode -warn-long-expression-type-checking=80 -serialize-debugging-options -Xcc -I/Users/stephen/Library/Developer/Xcode/DerivedData/Prelude-awcxhttffdukcidokfxfgfitwhjz/Build/Intermediates.noindex/Prelude.build/Debug/Prelude.build/swift-overrides.hmap -Xcc -I/Users/stephen/Library/Developer/Xcode/DerivedData/Prelude-awcxhttffdukcidokfxfgfitwhjz/Build/Products/Debug/include -Xcc -I/Users/stephen/Library/Developer/Xcode/DerivedData/Prelude-awcxhttffdukcidokfxfgfitwhjz/Build/Intermediates.noindex/Prelude.build/Debug/Prelude.build/DerivedSources/x86_64 -Xcc -I/Users/stephen/Library/Developer/Xcode/DerivedData/Prelude-awcxhttffdukcidokfxfgfitwhjz/Build/Intermediates.noindex/Prelude.build/Debug/Prelude.build/DerivedSources -Xcc -working-directory/Users/stephen/Developer/pointfreeco/swift-prelude -emit-module-doc-path /Users/stephen/Library/Developer/Xcode/DerivedData/Prelude-awcxhttffdukcidokfxfgfitwhjz/Build/Intermediates.noindex/Prelude.build/Debug/Prelude.build/Objects-normal/x86_64/IO~partial.swiftdoc -serialize-diagnostics-path /Users/stephen/Library/Developer/Xcode/DerivedData/Prelude-awcxhttffdukcidokfxfgfitwhjz/Build/Intermediates.noindex/Prelude.build/Debug/Prelude.build/Objects-normal/x86_64/IO.dia -module-name Prelude -emit-module-path /Users/stephen/Library/Developer/Xcode/DerivedData/Prelude-awcxhttffdukcidokfxfgfitwhjz/Build/Intermediates.noindex/Prelude.build/Debug/Prelude.build/Objects-normal/x86_64/IO~partial.swiftmodule -emit-dependencies-path /Users/stephen/Library/Developer/Xcode/DerivedData/Prelude-awcxhttffdukcidokfxfgfitwhjz/Build/Intermediates.noindex/Prelude.build/Debug/Prelude.build/Objects-normal/x86_64/IO.d -emit-reference-dependencies-path /Users/stephen/Library/Developer/Xcode/DerivedData/Prelude-awcxhttffdukcidokfxfgfitwhjz/Build/Intermediates.noindex/Prelude.build/Debug/Prelude.build/Objects-normal/x86_64/IO.swiftdeps -o /Users/stephen/Library/Developer/Xcode/DerivedData/Prelude-awcxhttffdukcidokfxfgfitwhjz/Build/Intermediates.noindex/Prelude.build/Debug/Prelude.build/Objects-normal/x86_64/IO.o -index-store-path /Users/stephen/Library/Developer/Xcode/DerivedData/Prelude-awcxhttffdukcidokfxfgfitwhjz/Index/DataStore -index-system-modules 
1.  While type-checking extension of IO<A> at /Users/stephen/Developer/pointfreeco/swift-prelude/Sources/Prelude/IO.swift:29:1
2.  While type-checking 'timeout(_:)' at /Users/stephen/Developer/pointfreeco/swift-prelude/Sources/Prelude/IO.swift:59:10
3.  While resolving type IO<Either<Prelude.Unit, A>> at [/Users/stephen/Developer/pointfreeco/swift-prelude/Sources/Prelude/IO.swift:59:52 - line:59:78] RangeText="IO<Either<Prelude.Unit, A>>"
4.  While resolving type Either<Prelude.Unit, A> at [/Users/stephen/Developer/pointfreeco/swift-prelude/Sources/Prelude/IO.swift:59:55 - line:59:77] RangeText="Either<Prelude.Unit, A>"
5.  While reading from 'Either'
6.  While deserializing extension of 'Either<L, R>' (ExtensionDecl #&#8203;53) in 'Either'
error: Abort trap: 6
@belkadan
Copy link
Contributor

Any special build instructions, or just a normal package manager build?

@swift-ci create

@stephencelis
Copy link
Contributor Author

Should build normally with SPM.

@stephencelis
Copy link
Contributor Author

I imagine it's just bad diagnostics on a cross-module reference. The Either module shouldn't be available to the Prelude module.

@belkadan
Copy link
Contributor

Reproduced. I had to first build the old version so that there was a built copy of Either lying around, and then build the new version. We'll keep this bug around for the crash, but @aciidb0mb3r, want one for the package manager to enforce target dependencies through folders?

@belkadan
Copy link
Contributor

(I'm pretty sure we've talked about this before.)

@ankitspd
Copy link
Member

@stephencelis You might have an implicit dependency cycle: Prelude/IO.swift is importing Either but Either depends on Prelude: https://github.com/pointfreeco/swift-prelude/blob/master/Package.swift#L24

@belkadan This? https://bugs.swift.org/browse/SR-1393 I hope we can fix this soon, it is very bad when it happens 🙁

@belkadan
Copy link
Contributor

Aha, yep, that was the one I was thinking of.

@belkadan
Copy link
Contributor

Added a diagnostic: #16075

@stephencelis
Copy link
Contributor Author

Um. Why was this closed when the PR is still open?

@belkadan
Copy link
Contributor

belkadan commented May 2, 2018

4.2 branch: #16315

@belkadan
Copy link
Contributor

belkadan commented May 3, 2018

Check out an upcoming development snapshot to verify that this is fixed!

@AnnaZaks
Copy link
Mannequin

AnnaZaks mannequin commented Jul 26, 2018

@stephencelis, Could you verify if the problem is fixed and if so move the JIRA to "Closed"?
Thanks!
Anna

@AnnaZaks
Copy link
Mannequin

AnnaZaks mannequin commented Sep 13, 2018

@stephencelis, Could you verify if the problem is fixed and/or move the JIRA to "Closed"?
Thanks!
Anna

@AnnaZaks
Copy link
Mannequin

AnnaZaks mannequin commented Oct 24, 2018

Closing the issue. Feel free to reopen if the issue is not fixed.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added the crash Bug: A crash, i.e., an abnormal termination of software label Dec 12, 2022
This issue was closed.
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 crash Bug: A crash, i.e., an abnormal termination of software serialization Area → compiler: Serialization & deserialization
Projects
None yet
Development

No branches or pull requests

4 participants