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-3707] Assertion failed: (hasInterfaceType() && "No interface type was set") #46292

Closed
tonyarnold opened this issue Jan 24, 2017 · 12 comments
Closed
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

Comments

@tonyarnold
Copy link
Contributor

Previous ID SR-3707
Radar rdar://problem/30172856
Original Reporter @tonyarnold
Type Bug
Status Resolved
Resolution Done

Attachment: Download

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

md5: bd0da7152d3cca1bff26194b60f67ab8

is duplicated by:

  • SR-3938 compiler seg fault on generic instantiation across file boundaries

Issue Description:

When using swift-3.1-DEVELOPMENT-SNAPSHOT-2017-01-22-a.xctoolchain with Xcode 8.2.1, if I open the project https://github.com/wokalski/Diff.swift indexing and building always fail, causing Swift to SIGABRT.

I've attached the crash log.

@tonyarnold
Copy link
Contributor Author

This may be an updated version of the crash as described in SR-3605, as it's happening on the same projects.

@belkadan
Copy link
Contributor

@swift-ci create

@slavapestov
Copy link
Member

@belkadan does this look like a circular-deserialization issue?

5   swift                           0x0000000104bed18d swift::TypeDecl::getDeclaredInterfaceType() const + 445
6   swift                           0x0000000104832230 swift::ModuleFile::getType(llvm::PointerEmbeddedInt<unsigned int, 31>) + 480
7   swift                           0x00000001048322c3 swift::ModuleFile::getType(llvm::PointerEmbeddedInt<unsigned int, 31>) + 627
8   swift                           0x0000000104832e35 swift::ModuleFile::getType(llvm::PointerEmbeddedInt<unsigned int, 31>) + 3557
9   swift                           0x0000000104833180 swift::ModuleFile::getType(llvm::PointerEmbeddedInt<unsigned int, 31>) + 4400
10  swift                           0x0000000104832526 swift::ModuleFile::getType(llvm::PointerEmbeddedInt<unsigned int, 31>) + 1238
11  swift                           0x0000000104830688 swift::ModuleFile::getDecl(llvm::PointerEmbeddedInt<unsigned int, 31>, llvm::Optional<swift::DeclContext*>) + 26568
12  swift                           0x0000000104838c31 swift::ModuleFile::readMembers(llvm::SmallVectorImpl<swift::Decl*>&) + 273
13  swift                           0x000000010483c5cf swift::ModuleFile::loadAllMembers(swift::Decl*, unsigned long long) + 239
14  swift                           0x0000000104c016fc swift::IterableDeclContext::loadAllMembers() const + 108
15  swift                           0x0000000104bedaa5 swift::ExtensionDecl::getMembers() const + 21
16  swift                           0x0000000104c3ee88 swift::NominalTypeDecl::lookupDirect(swift::DeclName, bool) + 56
17  swift                           0x000000010483a006 swift::ModuleFile::resolveCrossReference(swift::ModuleDecl*, unsigned int) + 4118
18  swift                           0x000000010482d5b2 swift::ModuleFile::getDecl(llvm::PointerEmbeddedInt<unsigned int, 31>, llvm::Optional<swift::DeclContext*>) + 14066
19  swift                           0x0000000104832ce0 swift::ModuleFile::getType(llvm::PointerEmbeddedInt<unsigned int, 31>) + 3216
20  swift                           0x0000000104832e35 swift::ModuleFile::getType(llvm::PointerEmbeddedInt<unsigned int, 31>) + 3557
21  swift                           0x0000000104833180 swift::ModuleFile::getType(llvm::PointerEmbeddedInt<unsigned int, 31>) + 4400
22  swift                           0x000000010482e3d4 swift::ModuleFile::getDecl(llvm::PointerEmbeddedInt<unsigned int, 31>, llvm::Optional<swift::DeclContext*>) + 17684
23  swift                           0x0000000104832207 swift::ModuleFile::getType(llvm::PointerEmbeddedInt<unsigned int, 31>) + 439
24  swift                           0x00000001048322c3 swift::ModuleFile::getType(llvm::PointerEmbeddedInt<unsigned int, 31>) + 627
25  swift                           0x0000000104832e35 swift::ModuleFile::getType(llvm::PointerEmbeddedInt<unsigned int, 31>) + 3557
26  swift                           0x0000000104832514 swift::ModuleFile::getType(llvm::PointerEmbeddedInt<unsigned int, 31>) + 1220
27  swift                           0x0000000104830688 swift::ModuleFile::getDecl(llvm::PointerEmbeddedInt<unsigned int, 31>, llvm::Optional<swift::DeclContext*>) + 26568
28  swift                           0x00000001048644ea swift::ModuleFile::getTopLevelDecls(llvm::SmallVectorImpl<swift::Decl*>&) + 970
29  swift                           0x0000000104c286cf swift::ModuleDecl::getTopLevelDecls(llvm::SmallVectorImpl<swift::Decl*>&) const + 63
30  swift                           0x00000001044708df swift::ClassHierarchyAnalysis::init() + 79
31  swift                           0x0000000104463c79 swift::createClassHierarchyAnalysis(swift::SILModule*) + 153
32  swift                           0x00000001045193ac swift::SILPassManager::SILPassManager(swift::SILModule*, llvm::StringRef) + 460
33  swift                           0x00000001045253ea swift::runSILDiagnosticPasses(swift::SILModule&) + 138
34  swift                           0x0000000103cf5a8e swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 13166

@belkadan
Copy link
Contributor

Not necessarily. It's possible it's just normal deep recursion. The PrettyStackTrace usually has more information.

@belkadan
Copy link
Contributor

   1.  While reading from /Users/jrose/Library/Developer/Xcode/DerivedData/Diff-elnzqdgptbfxbwgczppekaxewint/Build/Intermediates/Diff.build/Debug/Diff.build/Objects-normal/x86_64/ExtendedPatch~partial.swiftmodule
2.  While deserializing 'extendedPatch' (FuncDecl #&#8203;35)in 'Diff'
3.  While deserializing 'OrderedBefore' (TypeAliasDecl #&#8203;100)in 'Diff'
4.  While deserializing decl #&#8203;158 (XREF)in 'Diff'
5.  Cross-reference to module 'Diff'
    ... ExtendedDiff
    ... Element
6.  While loading members for extension of ExtendedDiff in module 'Diff'
7.  While deserializing 'patch' (FuncDecl #&#8203;101)in 'Diff'

@belkadan
Copy link
Contributor

Ah, yes, I suppose there is a circularity here. I can't see this being worse than it was in Xcode 8.2, though.

@belkadan
Copy link
Contributor

…but indeed somehow this works in 8.2.

@belkadan
Copy link
Contributor

This also happens during SIL diagnostic passes during the merge module step, which makes no sense. If we need to run any SIL passes at all during merge-module, they would still already be operating on canonical SIL. But fixing that wouldn't make the problem go away; it's coming from ClassHierarchyAnalysis.

@belkadan
Copy link
Contributor

I came up with a change to serialization that should avoid many circularity issues involving nested types: #7067

@belkadan
Copy link
Contributor

3.1: #7097

@belkadan
Copy link
Contributor

Merged into swift-3.1-branch in 13dd70a. Note that it will still take a while before this makes it into a release, but you should be able to try a snapshot soon.

@tonyarnold
Copy link
Contributor Author

Confirmed that this has fixed the build issues I have been seeing with the latest Swift 3.1 snapshot (2017-01-31-a). Indexing still crashes, but I'll file a separate issue for that.

Thanks, Jordan!

@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
Projects
None yet
Development

No branches or pull requests

4 participants