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-6711] Segfault when declaring extension of protocol in certain separate file under spooky conditions #49260

Open
swift-ci opened this issue Jan 6, 2018 · 1 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

Comments

@swift-ci
Copy link
Collaborator

swift-ci commented Jan 6, 2018

Previous ID SR-6711
Radar None
Original Reporter neightchan (JIRA User)
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Source Tooling
Labels Bug, CompilerCrash
Assignee None
Priority Medium

md5: 173a93aef886bad0d32b3569060b789e

Issue Description:

Not sure how to shrink this one yet. This segfault us occurring when declaring an extension on a type Foo in the same framework but in a different file B from the file A where Foo was declared. But in yet another file C there is an extension on Foo--and that extension's presence causes no problems. Also of potential note, there is an extension in A on Foo as well. To be clear, when this line of code occurs in B,

extension Foo {}

the segfault occurs.

0  swift                    0x000000010ad5636a PrintStackTraceSignalHandler(void*) + 42
1  swift                    0x000000010ad557a6 SignalHandler(int) + 662
2  libsystem_platform.dylib 0x00007fffd5abeb3a _sigtramp + 26
3  libsystem_malloc.dylib   0x00007fffd5a3291f tiny_malloc_from_free_list + 431
4  swift                    0x0000000108868380 swift::Mangle::ASTMangler::appendAssocType(swift::DependentMemberType*, bool&) + 320
5  swift                    0x0000000108864629 swift::Mangle::ASTMangler::appendType(swift::Type) + 4025
6  swift                    0x0000000108863df5 swift::Mangle::ASTMangler::appendType(swift::Type) + 1925
7  swift                    0x0000000108867532 swift::Mangle::ASTMangler::appendFunctionType(swift::AnyFunctionType*, bool) + 82
8  swift                    0x000000010886a02f swift::Mangle::ASTMangler::appendDeclType(swift::ValueDecl const*, bool) + 2271
9  swift                    0x00000001088696b1 swift::Mangle::ASTMangler::appendEntity(swift::ValueDecl const*, llvm::StringRef, bool) + 257
10 swift                    0x000000010886bc5b swift::Mangle::ASTMangler::mangleDeclAsUSR(swift::ValueDecl const*, llvm::StringRef) + 811
11 swift                    0x00000001089466c5 swift::ide::printDeclUSR(swift::ValueDecl const*, llvm::raw_ostream&) + 2293
12 swift                    0x000000010839a5c9 (anonymous namespace)::IndexSwiftASTWalker::getNameAndUSR(swift::ValueDecl*, swift::ExtensionDecl*, llvm::StringRef&, llvm::StringRef&) + 489
13 swift                    0x0000000108398a7f (anonymous namespace)::IndexSwiftASTWalker::initIndexSymbol(swift::ValueDecl*, swift::SourceLoc, bool, swift::index::IndexSymbol&) + 175
14 swift                    0x0000000108396dd4 (anonymous namespace)::IndexSwiftASTWalker::walkToDeclPre(swift::Decl*, swift::CharSourceRange) + 2580
15 swift                    0x000000010892cd2e (anonymous namespace)::SemaAnnotator::walkToDeclPre(swift::Decl*) + 1022
16 swift                    0x0000000108893218 (anonymous namespace)::Traversal::doIt(swift::Decl*) + 280
17 swift                    0x000000010889399f (anonymous namespace)::Traversal::visitParameterList(swift::ParameterList*) + 95
18 swift                    0x000000010889588b (anonymous namespace)::Traversal::visitAbstractFunctionDecl(swift::AbstractFunctionDecl*) + 267
19 swift                    0x000000010889328b (anonymous namespace)::Traversal::doIt(swift::Decl*) + 395
20 swift                    0x000000010889574b (anonymous namespace)::Traversal::visitNominalTypeDecl(swift::NominalTypeDecl*) + 475
21 swift                    0x000000010889327e (anonymous namespace)::Traversal::doIt(swift::Decl*) + 382
22 swift                    0x000000010892bc5f swift::SourceEntityWalker::walk(swift::SourceFile&) + 223
23 swift                    0x000000010839b71e (anonymous namespace)::IndexSwiftASTWalker::visitModule(swift::ModuleDecl&, llvm::StringRef) + 510
24 swift                    0x000000010839b4f9 swift::index::indexSourceFile(swift::SourceFile*, llvm::StringRef, swift::index::IndexDataConsumer&) + 457
25 swift                    0x000000010839f59e recordSourceFileUnit(swift::SourceFile*, llvm::StringRef, llvm::StringRef, bool, bool, llvm::StringRef, llvm::ArrayRef<clang::FileEntry const*>, clang::CompilerInstance const&, swift::DiagnosticEngine&) + 2142
26 swift                    0x00000001076b6d5f emitIndexData(swift::SourceFile*, swift::CompilerInvocation const&, swift::CompilerInstance&) + 1119
27 swift                    0x00000001076b3ce8 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 17032
28 swift                    0x00000001076ae1f4 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 7716
29 swift                    0x0000000107662e78 main + 12248
30 libdyld.dylib            0x00007fffd58af235 start + 1
31 libdyld.dylib            0x0000000000000064 start + 712314416
@belkadan
Copy link
Contributor

belkadan commented Jan 8, 2018

Any chance you can share the entire project, then? If not publicly, at least with Apple at https://bugreport.apple.com ?

@nkcsgexi, @nathawes, sound familiar?

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added crash Bug: A crash, i.e., an abnormal termination of software compiler The Swift compiler in itself labels Dec 12, 2022
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

3 participants