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-4208] Crash when deserializing module where one extension uses another extension #46791

Closed
tjw opened this issue Mar 9, 2017 · 3 comments
Closed

Comments

@tjw
Copy link
Contributor

@tjw tjw commented Mar 9, 2017

Previous ID SR-4208
Radar rdar://problem/30976604
Original Reporter @tjw
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Environment

macOS 10.12.3
Xcode 8.3 b4

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, 3.1Regression, CompilerCrash, Serialization
Assignee None
Priority Medium

md5: ad707adbe735663faa40d2f1245ca54c

Issue Description:

Crash when deserializing module

  • Open the attached project in Xcode 8.3 b4

  • Build

0  swift                    0x000000010f6a5ef7 PrintStackTraceSignalHandler(void*) + 39
1  swift                    0x000000010f6a53a6 SignalHandler(int) + 646
2  libsystem_platform.dylib 0x00007fffbb38ebba _sigtramp + 26
3  libsystem_platform.dylib 0x00007ff44813c4d8 _sigtramp + 2363152696
4  libsystem_c.dylib        0x00007fffbb215420 abort + 129
5  swift                    0x000000010d109264 swift::ModuleFile::getDecl(llvm::PointerEmbeddedInt<unsigned int, 31>, llvm::Optional<swift::DeclContext*>) + 38404
6  swift                    0x000000010d10aaae swift::ModuleFile::getType(llvm::PointerEmbeddedInt<unsigned int, 31>) + 462
7  swift                    0x000000010d103f93 swift::ModuleFile::getDecl(llvm::PointerEmbeddedInt<unsigned int, 31>, llvm::Optional<swift::DeclContext*>) + 17203
8  swift                    0x000000010d10eb44 swift::ModuleFile::maybeReadPattern(swift::DeclContext*) + 740
9  swift                    0x000000010d10ec55 swift::ModuleFile::maybeReadPattern(swift::DeclContext*) + 1013
10 swift                    0x000000010d104225 swift::ModuleFile::getDecl(llvm::PointerEmbeddedInt<unsigned int, 31>, llvm::Optional<swift::DeclContext*>) + 17861
11 swift                    0x000000010d1153e8 swift::ModuleFile::loadAllMembers(swift::Decl*, unsigned long long) + 600
12 swift                    0x000000010d53d10d swift::NominalTypeDecl::lookupDirect(swift::DeclName, bool) + 349
13 swift                    0x000000010d1072a6 swift::ModuleFile::getDecl(llvm::PointerEmbeddedInt<unsigned int, 31>, llvm::Optional<swift::DeclContext*>) + 30278
14 swift                    0x000000010d10aaae swift::ModuleFile::getType(llvm::PointerEmbeddedInt<unsigned int, 31>) + 462
15 swift                    0x000000010d10bfb0 swift::ModuleFile::getType(llvm::PointerEmbeddedInt<unsigned int, 31>) + 5840
16 swift                    0x000000010d104967 swift::ModuleFile::getDecl(llvm::PointerEmbeddedInt<unsigned int, 31>, llvm::Optional<swift::DeclContext*>) + 19719
17 swift                    0x000000010d13052c swift::ModuleFile::getTopLevelDecls(llvm::SmallVectorImpl<swift::Decl*>&) + 1980
18 swift                    0x000000010ce4f4d0 swift::SILPassManager::SILPassManager(swift::SILModule*, llvm::StringRef) + 1376
19 swift                    0x000000010ce5612f swift::runSILDiagnosticPasses(swift::SILModule&) + 159
20 swift                    0x000000010c4c5f42 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 42866
21 swift                    0x000000010c4755cc main + 9052
22 libdyld.dylib            0x00007fffbb181255 start + 1
23 libdyld.dylib            0x0000000000000035 start + 1156050401
Stack dump:
0.  Program arguments: /Applications/Xcode-8.3-b4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -emit-module /Users/bungi/Library/Developer/Xcode/DerivedData/RangeAndStringExtension-botiiyfhkecfzuflifybkyruxoch/Build/Intermediates/RangeAndStringExtension.build/Debug/RangeAndStringExtension.build/Objects-normal/x86_64/String~partial.swiftmodule /Users/bungi/Library/Developer/Xcode/DerivedData/RangeAndStringExtension-botiiyfhkecfzuflifybkyruxoch/Build/Intermediates/RangeAndStringExtension.build/Debug/RangeAndStringExtension.build/Objects-normal/x86_64/main~partial.swiftmodule /Users/bungi/Library/Developer/Xcode/DerivedData/RangeAndStringExtension-botiiyfhkecfzuflifybkyruxoch/Build/Intermediates/RangeAndStringExtension.build/Debug/RangeAndStringExtension.build/Objects-normal/x86_64/Range~partial.swiftmodule -parse-as-library -target x86_64-apple-macosx10.12 -enable-objc-interop -sdk /Applications/Xcode-8.3-b4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -I /Users/bungi/Library/Developer/Xcode/DerivedData/RangeAndStringExtension-botiiyfhkecfzuflifybkyruxoch/Build/Products/Debug -F /Users/bungi/Library/Developer/Xcode/DerivedData/RangeAndStringExtension-botiiyfhkecfzuflifybkyruxoch/Build/Products/Debug -enable-testing -g -module-cache-path /Users/bungi/Library/Developer/Xcode/DerivedData/ModuleCache -serialize-debugging-options -Xcc -I/Users/bungi/Library/Developer/Xcode/DerivedData/RangeAndStringExtension-botiiyfhkecfzuflifybkyruxoch/Build/Intermediates/RangeAndStringExtension.build/Debug/RangeAndStringExtension.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/bungi/Library/Developer/Xcode/DerivedData/RangeAndStringExtension-botiiyfhkecfzuflifybkyruxoch/Build/Intermediates/RangeAndStringExtension.build/Debug/RangeAndStringExtension.build/RangeAndStringExtension-generated-files.hmap -Xcc -I/Users/bungi/Library/Developer/Xcode/DerivedData/RangeAndStringExtension-botiiyfhkecfzuflifybkyruxoch/Build/Intermediates/RangeAndStringExtension.build/Debug/RangeAndStringExtension.build/RangeAndStringExtension-own-target-headers.hmap -Xcc -I/Users/bungi/Library/Developer/Xcode/DerivedData/RangeAndStringExtension-botiiyfhkecfzuflifybkyruxoch/Build/Intermediates/RangeAndStringExtension.build/Debug/RangeAndStringExtension.build/RangeAndStringExtension-all-target-headers.hmap -Xcc -iquote -Xcc /Users/bungi/Library/Developer/Xcode/DerivedData/RangeAndStringExtension-botiiyfhkecfzuflifybkyruxoch/Build/Intermediates/RangeAndStringExtension.build/Debug/RangeAndStringExtension.build/RangeAndStringExtension-project-headers.hmap -Xcc -I/Users/bungi/Library/Developer/Xcode/DerivedData/RangeAndStringExtension-botiiyfhkecfzuflifybkyruxoch/Build/Products/Debug/include -Xcc -I/Users/bungi/Library/Developer/Xcode/DerivedData/RangeAndStringExtension-botiiyfhkecfzuflifybkyruxoch/Build/Intermediates/RangeAndStringExtension.build/Debug/RangeAndStringExtension.build/DerivedSources/x86_64 -Xcc -I/Users/bungi/Library/Developer/Xcode/DerivedData/RangeAndStringExtension-botiiyfhkecfzuflifybkyruxoch/Build/Intermediates/RangeAndStringExtension.build/Debug/RangeAndStringExtension.build/DerivedSources -Xcc -DDEBUG=1 -Xcc -working-directory/Users/bungi/Source/Staff/bungi/Radar/Swift/RangeAndStringExtension -emit-module-doc-path /Users/bungi/Library/Developer/Xcode/DerivedData/RangeAndStringExtension-botiiyfhkecfzuflifybkyruxoch/Build/Intermediates/RangeAndStringExtension.build/Debug/RangeAndStringExtension.build/Objects-normal/x86_64/RangeAndStringExtension.swiftdoc -module-name RangeAndStringExtension -emit-objc-header-path /Users/bungi/Library/Developer/Xcode/DerivedData/RangeAndStringExtension-botiiyfhkecfzuflifybkyruxoch/Build/Intermediates/RangeAndStringExtension.build/Debug/RangeAndStringExtension.build/Objects-normal/x86_64/RangeAndStringExtension-Swift.h -o /Users/bungi/Library/Developer/Xcode/DerivedData/RangeAndStringExtension-botiiyfhkecfzuflifybkyruxoch/Build/Intermediates/RangeAndStringExtension.build/Debug/RangeAndStringExtension.build/Objects-normal/x86_64/RangeAndStringExtension.swiftmodule 
1.  While reading from /Users/bungi/Library/Developer/Xcode/DerivedData/RangeAndStringExtension-botiiyfhkecfzuflifybkyruxoch/Build/Intermediates/RangeAndStringExtension.build/Debug/RangeAndStringExtension.build/Objects-normal/x86_64/Range~partial.swiftmodule
2.  While deserializing 'StringRange' (TypeAliasDecl #&#8203;1)in 'RangeAndStringExtension'
3.  While deserializing decl #&#8203;3 (XREF)in 'RangeAndStringExtension'
4.  Cross-reference to module 'Swift'
    ... String
    ... in an extension in module 'Swift'
    ... Index
5.  While loading members for extension of String in module 'RangeAndStringExtension'
6.  While deserializing PatternBindingDecl #&#8203;42in 'RangeAndStringExtension'
7.  While deserializing 'wholeRange' (VarDecl #&#8203;43)in 'RangeAndStringExtension'
8.  While deserializing decl #&#8203;54 (XREF)in 'RangeAndStringExtension'
9.  Cross-reference to module 'RangeAndStringExtension'
    ... StringRange
@belkadan
Copy link
Contributor

@belkadan belkadan commented Mar 10, 2017

@swift-ci create

@slavapestov
Copy link
Member

@slavapestov slavapestov commented May 17, 2017

@slavapestov
Copy link
Member

@slavapestov slavapestov commented May 17, 2017

The change is now merged into master. Here's a PR for 4.0-branch also: #9686

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants