Skip to content

[SR-1806] Swift 3 Preview 1 Segmentation Fault in getSILFunctionType() #44415

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

Closed
swift-ci opened this issue Jun 17, 2016 · 2 comments
Closed
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler itself crash Bug: A crash, i.e., an abnormal termination of software SILGen Area → compiler: The SIL generation stage

Comments

@swift-ci
Copy link
Contributor

Previous ID SR-1806
Radar None
Original Reporter pwestrich (JIRA User)
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Environment

macOS Sierra DeveloperPreview 1 (16A201w)
Xcode 8 beta (8S128d)
Apple Swift version 3.0 (swiftlang-800.0.30 clang-800.0.24) Target: x86_64-apple-macosx10.9

Additional Detail from JIRA
Votes 1
Component/s Compiler
Labels Bug, CompilerCrash, SILGen
Assignee @slavapestov
Priority Medium

md5: 5e07c41e934d87ff1a99e3ef23fbd32a

Issue Description:

I was attempting to update one of my projects to work with Swift 3, and I've encountered a segmentation fault in the compiler when trying to build one of the libraries I'm updating. I've attached the specific file that's causing it, and the stack trace is below. This file builds perfectly fine when using Xcode 7.3.1 (7D1014) before the syntax update.

$swift ChartDataEntry.swift 
0  swift                    0x000000010342e34b llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 43
1  swift                    0x000000010342d636 llvm::sys::RunSignalHandlers() + 70
2  swift                    0x000000010342e99f SignalHandler(int) + 287
3  libsystem_platform.dylib 0x00007fffb494a01a _sigtramp + 26
4  libsystem_platform.dylib 000000000000000000 _sigtramp + 1265328128
5  swift                    0x00000001013230d9 getSILFunctionType(swift::SILModule&, swift::Lowering::AbstractionPattern, swift::CanTypeWrapper<swift::AnyFunctionType>, swift::AnyFunctionType::ExtInfo, (anonymous namespace)::Conventions const&, llvm::Optional<swift::ForeignErrorConvention> const&, llvm::Optional<swift::SILDeclRef>) + 1081
6  swift                    0x00000001013208b6 getUncachedSILFunctionTypeForConstant(swift::SILModule&, swift::SILDeclRef, swift::CanTypeWrapper<swift::AnyFunctionType>) + 1254
7  swift                    0x000000010102a1bc getDynamicMethodLoweredType(swift::Lowering::SILGenFunction&, swift::SILValue, swift::SILDeclRef, swift::CanTypeWrapper<swift::AnyFunctionType>) + 220
8  swift                    0x00000001010299bc swift::Lowering::SILGenFunction::emitDynamicMemberRefExpr(swift::DynamicMemberRefExpr*, swift::Lowering::SGFContext) + 1196
9  swift                    0x0000000101058180 swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 1920
10 swift                    0x0000000101061b89 void llvm::function_ref<void (swift::Expr*)>::callback_fn<swift::Lowering::RValue swift::Lowering::SILGenFunction::emitOpenExistentialExpr<swift::Lowering::RValue, (anonymous namespace)::RValueEmitter::visitOpenExistentialExpr(swift::OpenExistentialExpr*, swift::Lowering::SGFContext)::$_4>(swift::OpenExistentialExpr*, (anonymous namespace)::RValueEmitter::visitOpenExistentialExpr(swift::OpenExistentialExpr*, swift::Lowering::SGFContext)::$_4)::'lambda'(swift::Expr*)>(long, swift::Expr*) + 41
11 swift                    0x00000001010571da swift::Lowering::SILGenFunction::emitOpenExistentialExprImpl(swift::OpenExistentialExpr*, llvm::function_ref<void (swift::Expr*)>) + 954
12 swift                    0x0000000101061b01 swift::Lowering::RValue swift::Lowering::SILGenFunction::emitOpenExistentialExpr<swift::Lowering::RValue, (anonymous namespace)::RValueEmitter::visitOpenExistentialExpr(swift::OpenExistentialExpr*, swift::Lowering::SGFContext)::$_4>(swift::OpenExistentialExpr*, (anonymous namespace)::RValueEmitter::visitOpenExistentialExpr(swift::OpenExistentialExpr*, swift::Lowering::SGFContext)::$_4) + 65
13 swift                    0x0000000101059070 swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 5744
14 swift                    0x00000001010535a8 swift::Lowering::SILGenFunction::emitExprInto(swift::Expr*, swift::Lowering::Initialization*) + 280
15 swift                    0x0000000101061664 (anonymous namespace)::RValueEmitter::emitForceValue(swift::SILLocation, swift::Expr*, unsigned int, swift::Lowering::SGFContext) + 756
16 swift                    0x000000010105904b swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 5707
17 swift                    0x00000001010567bf swift::Lowering::SILGenFunction::emitRValueAsSingleValue(swift::Expr*, swift::Lowering::SGFContext) + 47
18 swift                    0x0000000101058ee4 swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 5348
19 swift                    0x00000001010567bf swift::Lowering::SILGenFunction::emitRValueAsSingleValue(swift::Expr*, swift::Lowering::SGFContext) + 47
20 swift                    0x000000010108a49a swift::Lowering::SILGenFunction::emitRValueAsOrig(swift::Expr*, swift::Lowering::AbstractionPattern, swift::Lowering::TypeLowering const&, swift::Lowering::SGFContext) + 346
21 swift                    0x0000000101062a61 swift::Lowering::ManagedValue llvm::function_ref<swift::Lowering::ManagedValue (swift::Lowering::SGFContext)>::callback_fn<(anonymous namespace)::RValueEmitter::visitErasureExpr(swift::ErasureExpr*, swift::Lowering::SGFContext)::$_3>(long, swift::Lowering::SGFContext) + 113
22 swift                    0x0000000101044eb0 swift::Lowering::SILGenFunction::emitExistentialErasure(swift::SILLocation, swift::CanType, swift::Lowering::TypeLowering const&, swift::Lowering::TypeLowering const&, llvm::ArrayRef<swift::ProtocolConformanceRef>, swift::Lowering::SGFContext, llvm::function_ref<swift::Lowering::ManagedValue (swift::Lowering::SGFContext)>) + 1120
23 swift                    0x00000001010598c1 swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 7873
24 swift                    0x00000001010567bf swift::Lowering::SILGenFunction::emitRValueAsSingleValue(swift::Expr*, swift::Lowering::SGFContext) + 47
25 swift                    0x000000010100f704 swift::Lowering::ArgumentSource::getAsSingleValue(swift::Lowering::SILGenFunction&, swift::Lowering::SGFContext) && + 340
26 swift                    0x000000010100f7bd swift::Lowering::ArgumentSource::getAsSingleValue(swift::Lowering::SILGenFunction&, swift::Lowering::AbstractionPattern, swift::Lowering::SGFContext) && + 157
27 swift                    0x000000010102295e swift::Lowering::SILGenFunction::emitInjectEnum(swift::SILLocation, swift::Lowering::ArgumentSource, swift::SILType, swift::EnumElementDecl*, swift::Lowering::SGFContext) + 1726
28 swift                    0x000000010105f988 swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 32648
29 swift                    0x00000001010567bf swift::Lowering::SILGenFunction::emitRValueAsSingleValue(swift::Expr*, swift::Lowering::SGFContext) + 47
30 swift                    0x000000010105ccfc swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 21244
31 swift                    0x0000000101053656 swift::Lowering::SILGenFunction::emitRValue(swift::Expr*, swift::Lowering::SGFContext) + 22
32 swift                    0x000000010103287d (anonymous namespace)::ArgEmitter::emit(swift::Lowering::ArgumentSource&&, swift::Lowering::AbstractionPattern) + 1069
33 swift                    0x00000001010332d5 (anonymous namespace)::ArgEmitter::emitExpanded(swift::Lowering::ArgumentSource&&, swift::Lowering::AbstractionPattern) + 261
34 swift                    0x0000000101032520 (anonymous namespace)::ArgEmitter::emit(swift::Lowering::ArgumentSource&&, swift::Lowering::AbstractionPattern) + 208
35 swift                    0x0000000101031c87 (anonymous namespace)::CallSite::emit(swift::Lowering::SILGenFunction&, swift::Lowering::AbstractionPattern, (anonymous namespace)::ParamLowering&, llvm::SmallVectorImpl<swift::Lowering::ManagedValue>&, llvm::SmallVectorImpl<std::__1::pair<swift::Lowering::LValue, swift::SILLocation> >&, llvm::Optional<swift::ForeignErrorConvention> const&, swift::ImportAsMemberStatus const&) && + 455
36 swift                    0x00000001010241ee (anonymous namespace)::CallEmission::apply(swift::Lowering::SGFContext) + 3886
37 swift                    0x0000000101022c33 swift::Lowering::SILGenFunction::emitApplyExpr(swift::Expr*, swift::Lowering::SGFContext) + 51
38 swift                    0x0000000101057a53 swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 83
39 swift                    0x00000001010567bf swift::Lowering::SILGenFunction::emitRValueAsSingleValue(swift::Expr*, swift::Lowering::SGFContext) + 47
40 swift                    0x000000010100f704 swift::Lowering::ArgumentSource::getAsSingleValue(swift::Lowering::SILGenFunction&, swift::Lowering::SGFContext) && + 340
41 swift                    0x0000000101032fad (anonymous namespace)::ArgEmitter::emit(swift::Lowering::ArgumentSource&&, swift::Lowering::AbstractionPattern) + 2909
42 swift                    0x00000001010332d5 (anonymous namespace)::ArgEmitter::emitExpanded(swift::Lowering::ArgumentSource&&, swift::Lowering::AbstractionPattern) + 261
43 swift                    0x0000000101032520 (anonymous namespace)::ArgEmitter::emit(swift::Lowering::ArgumentSource&&, swift::Lowering::AbstractionPattern) + 208
44 swift                    0x0000000101031c87 (anonymous namespace)::CallSite::emit(swift::Lowering::SILGenFunction&, swift::Lowering::AbstractionPattern, (anonymous namespace)::ParamLowering&, llvm::SmallVectorImpl<swift::Lowering::ManagedValue>&, llvm::SmallVectorImpl<std::__1::pair<swift::Lowering::LValue, swift::SILLocation> >&, llvm::Optional<swift::ForeignErrorConvention> const&, swift::ImportAsMemberStatus const&) && + 455
45 swift                    0x00000001010241ee (anonymous namespace)::CallEmission::apply(swift::Lowering::SGFContext) + 3886
46 swift                    0x0000000101022c33 swift::Lowering::SILGenFunction::emitApplyExpr(swift::Expr*, swift::Lowering::SGFContext) + 51
47 swift                    0x0000000101057a53 swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 83
48 swift                    0x000000010105ae6c swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 13420
49 swift                    0x0000000101053656 swift::Lowering::SILGenFunction::emitRValue(swift::Expr*, swift::Lowering::SGFContext) + 22
50 swift                    0x000000010103287d (anonymous namespace)::ArgEmitter::emit(swift::Lowering::ArgumentSource&&, swift::Lowering::AbstractionPattern) + 1069
51 swift                    0x0000000101031c87 (anonymous namespace)::CallSite::emit(swift::Lowering::SILGenFunction&, swift::Lowering::AbstractionPattern, (anonymous namespace)::ParamLowering&, llvm::SmallVectorImpl<swift::Lowering::ManagedValue>&, llvm::SmallVectorImpl<std::__1::pair<swift::Lowering::LValue, swift::SILLocation> >&, llvm::Optional<swift::ForeignErrorConvention> const&, swift::ImportAsMemberStatus const&) && + 455
52 swift                    0x00000001010241ee (anonymous namespace)::CallEmission::apply(swift::Lowering::SGFContext) + 3886
53 swift                    0x0000000101022c33 swift::Lowering::SILGenFunction::emitApplyExpr(swift::Expr*, swift::Lowering::SGFContext) + 51
54 swift                    0x0000000101057a53 swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 83
55 swift                    0x0000000101053656 swift::Lowering::SILGenFunction::emitRValue(swift::Expr*, swift::Lowering::SGFContext) + 22
56 swift                    0x00000001010474cc swift::Lowering::SILGenFunction::emitStmtCondition(llvm::MutableArrayRef<swift::StmtConditionElement>, swift::Lowering::JumpDest, swift::SILLocation) + 732
57 swift                    0x000000010109ceba swift::ASTVisitor<(anonymous namespace)::StmtEmitter, void, void, void, void, void, void>::visit(swift::Stmt*) + 6266
58 swift                    0x000000010109c281 swift::ASTVisitor<(anonymous namespace)::StmtEmitter, void, void, void, void, void, void>::visit(swift::Stmt*) + 3137
59 swift                    0x000000010109b635 swift::Lowering::SILGenFunction::emitStmt(swift::Stmt*) + 21
60 swift                    0x0000000101067695 swift::Lowering::SILGenFunction::emitFunction(swift::FuncDecl*) + 309
61 swift                    0x000000010101ed16 swift::Lowering::SILGenModule::emitFunction(swift::FuncDecl*)::$_1::operator()(swift::SILFunction*) const + 198
62 swift                    0x00000001010176e2 swift::Lowering::SILGenModule::emitFunction(swift::FuncDecl*) + 610
63 swift                    0x00000001010a0595 (anonymous namespace)::SILGenType::emitType() + 1013
64 swift                    0x00000001010a012e swift::Lowering::SILGenModule::visitNominalTypeDecl(swift::NominalTypeDecl*) + 30
65 swift                    0x000000010101c1db swift::Lowering::SILGenModule::emitSourceFile(swift::SourceFile*, unsigned int) + 747
66 swift                    0x000000010101ce72 swift::SILModule::constructSIL(swift::ModuleDecl*, swift::SILOptions&, swift::FileUnit*, llvm::Optional<unsigned int>, bool, bool) + 898
67 swift                    0x000000010101d216 swift::performSILGeneration(swift::ModuleDecl*, swift::SILOptions&, bool, bool) + 38
68 swift                    0x0000000100eee850 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*) + 13024
69 swift                    0x0000000100eea619 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2873
70 swift                    0x0000000100eb86c4 main + 2852
71 libdyld.dylib            0x00007fffb473f285 start + 1
Stack dump:
0.  Program arguments: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -interpret ChartDataEntry.swift -target x86_64-apple-macosx10.9 -enable-objc-interop -sdk /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -color-diagnostics -module-name ChartDataEntry 
1.  While emitting SIL for 'isEqual' at ChartDataEntry.swift:52:21
Segmentation fault: 11
@swift-ci
Copy link
Contributor Author

Comment by Philip Westrich (JIRA)

The problem still exists in Developer Preview 2. I reduced the code to the minimal needed to produce the crash, and here's the new stack trace. It's identical except for the function addresses and one function call at frame #14. CrashExample.swift

$swift CrashExample.swift 
0  swift                    0x00000001032d567b llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 43
1  swift                    0x00000001032d4966 llvm::sys::RunSignalHandlers() + 70
2  swift                    0x00000001032d5ccf SignalHandler(int) + 287
3  libsystem_platform.dylib 0x00007fffbeed701a _sigtramp + 26
4  libsystem_platform.dylib 0x0000000000000400 _sigtramp + 1091736576
5  swift                    0x000000010116a2e9 getSILFunctionType(swift::SILModule&, swift::Lowering::AbstractionPattern, swift::CanTypeWrapper<swift::AnyFunctionType>, swift::AnyFunctionType::ExtInfo, (anonymous namespace)::Conventions const&, llvm::Optional<swift::ForeignErrorConvention> const&, llvm::Optional<swift::SILDeclRef>) + 1081
6  swift                    0x0000000101167ac6 getUncachedSILFunctionTypeForConstant(swift::SILModule&, swift::SILDeclRef, swift::CanTypeWrapper<swift::AnyFunctionType>) + 1254
7  swift                    0x0000000100e7273c getDynamicMethodLoweredType(swift::Lowering::SILGenFunction&, swift::SILValue, swift::SILDeclRef, swift::CanTypeWrapper<swift::AnyFunctionType>) + 220
8  swift                    0x0000000100e71f3c swift::Lowering::SILGenFunction::emitDynamicMemberRefExpr(swift::DynamicMemberRefExpr*, swift::Lowering::SGFContext) + 1196
9  swift                    0x0000000100ea03ba swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 1786
10 swift                    0x0000000100eaa0e9 void llvm::function_ref<void (swift::Expr*)>::callback_fn<swift::Lowering::RValue swift::Lowering::SILGenFunction::emitOpenExistentialExpr<swift::Lowering::RValue, (anonymous namespace)::RValueEmitter::visitOpenExistentialExpr(swift::OpenExistentialExpr*, swift::Lowering::SGFContext)::$_4>(swift::OpenExistentialExpr*, (anonymous namespace)::RValueEmitter::visitOpenExistentialExpr(swift::OpenExistentialExpr*, swift::Lowering::SGFContext)::$_4)::'lambda'(swift::Expr*)>(long, swift::Expr*) + 41
11 swift                    0x0000000100e9f49a swift::Lowering::SILGenFunction::emitOpenExistentialExprImpl(swift::OpenExistentialExpr*, llvm::function_ref<void (swift::Expr*)>) + 954
12 swift                    0x0000000100eaa061 swift::Lowering::RValue swift::Lowering::SILGenFunction::emitOpenExistentialExpr<swift::Lowering::RValue, (anonymous namespace)::RValueEmitter::visitOpenExistentialExpr(swift::OpenExistentialExpr*, swift::Lowering::SGFContext)::$_4>(swift::OpenExistentialExpr*, (anonymous namespace)::RValueEmitter::visitOpenExistentialExpr(swift::OpenExistentialExpr*, swift::Lowering::SGFContext)::$_4) + 65
13 swift                    0x0000000100ea10d6 swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 5142
14 swift                    0x0000000100e9ea4f swift::Lowering::SILGenFunction::emitRValueAsSingleValue(swift::Expr*, swift::Lowering::SGFContext) + 47
15 swift                    0x0000000100ea9c26 (anonymous namespace)::RValueEmitter::emitForceValue(swift::SILLocation, swift::Expr*, unsigned int, swift::Lowering::SGFContext) + 662
16 swift                    0x0000000100ea10b2 swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 5106
17 swift                    0x0000000100e9ea4f swift::Lowering::SILGenFunction::emitRValueAsSingleValue(swift::Expr*, swift::Lowering::SGFContext) + 47
18 swift                    0x0000000100ea0f4c swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 4748
19 swift                    0x0000000100e9ea4f swift::Lowering::SILGenFunction::emitRValueAsSingleValue(swift::Expr*, swift::Lowering::SGFContext) + 47
20 swift                    0x0000000100ed28fa swift::Lowering::SILGenFunction::emitRValueAsOrig(swift::Expr*, swift::Lowering::AbstractionPattern, swift::Lowering::TypeLowering const&, swift::Lowering::SGFContext) + 346
21 swift                    0x0000000100eaafc1 swift::Lowering::ManagedValue llvm::function_ref<swift::Lowering::ManagedValue (swift::Lowering::SGFContext)>::callback_fn<(anonymous namespace)::RValueEmitter::visitErasureExpr(swift::ErasureExpr*, swift::Lowering::SGFContext)::$_3>(long, swift::Lowering::SGFContext) + 113
22 swift                    0x0000000100e8d580 swift::Lowering::SILGenFunction::emitExistentialErasure(swift::SILLocation, swift::CanType, swift::Lowering::TypeLowering const&, swift::Lowering::TypeLowering const&, llvm::ArrayRef<swift::ProtocolConformanceRef>, swift::Lowering::SGFContext, llvm::function_ref<swift::Lowering::ManagedValue (swift::Lowering::SGFContext)>) + 1120
23 swift                    0x0000000100ea1924 swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 7268
24 swift                    0x0000000100e9ea4f swift::Lowering::SILGenFunction::emitRValueAsSingleValue(swift::Expr*, swift::Lowering::SGFContext) + 47
25 swift                    0x0000000100e57ca4 swift::Lowering::ArgumentSource::getAsSingleValue(swift::Lowering::SILGenFunction&, swift::Lowering::SGFContext) && + 340
26 swift                    0x0000000100e57d5d swift::Lowering::ArgumentSource::getAsSingleValue(swift::Lowering::SILGenFunction&, swift::Lowering::AbstractionPattern, swift::Lowering::SGFContext) && + 157
27 swift                    0x0000000100e6aede swift::Lowering::SILGenFunction::emitInjectEnum(swift::SILLocation, swift::Lowering::ArgumentSource, swift::SILType, swift::EnumElementDecl*, swift::Lowering::SGFContext) + 1726
28 swift                    0x0000000100ea7e94 swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 33236
29 swift                    0x0000000100e9ea4f swift::Lowering::SILGenFunction::emitRValueAsSingleValue(swift::Expr*, swift::Lowering::SGFContext) + 47
30 swift                    0x0000000100ea521b swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 21851
31 swift                    0x0000000100e9bca6 swift::Lowering::SILGenFunction::emitRValue(swift::Expr*, swift::Lowering::SGFContext) + 22
32 swift                    0x0000000100e7ad0d (anonymous namespace)::ArgEmitter::emit(swift::Lowering::ArgumentSource&&, swift::Lowering::AbstractionPattern) + 1069
33 swift                    0x0000000100e7b765 (anonymous namespace)::ArgEmitter::emitExpanded(swift::Lowering::ArgumentSource&&, swift::Lowering::AbstractionPattern) + 261
34 swift                    0x0000000100e7a9b0 (anonymous namespace)::ArgEmitter::emit(swift::Lowering::ArgumentSource&&, swift::Lowering::AbstractionPattern) + 208
35 swift                    0x0000000100e7a117 (anonymous namespace)::CallSite::emit(swift::Lowering::SILGenFunction&, swift::Lowering::AbstractionPattern, (anonymous namespace)::ParamLowering&, llvm::SmallVectorImpl<swift::Lowering::ManagedValue>&, llvm::SmallVectorImpl<std::__1::pair<swift::Lowering::LValue, swift::SILLocation> >&, llvm::Optional<swift::ForeignErrorConvention> const&, swift::ImportAsMemberStatus const&) && + 455
36 swift                    0x0000000100e6c76e (anonymous namespace)::CallEmission::apply(swift::Lowering::SGFContext) + 3886
37 swift                    0x0000000100e6b1b3 swift::Lowering::SILGenFunction::emitApplyExpr(swift::Expr*, swift::Lowering::SGFContext) + 51
38 swift                    0x0000000100e9fd13 swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 83
39 swift                    0x0000000100e9ea4f swift::Lowering::SILGenFunction::emitRValueAsSingleValue(swift::Expr*, swift::Lowering::SGFContext) + 47
40 swift                    0x0000000100e57ca4 swift::Lowering::ArgumentSource::getAsSingleValue(swift::Lowering::SILGenFunction&, swift::Lowering::SGFContext) && + 340
41 swift                    0x0000000100e7b43d (anonymous namespace)::ArgEmitter::emit(swift::Lowering::ArgumentSource&&, swift::Lowering::AbstractionPattern) + 2909
42 swift                    0x0000000100e7b765 (anonymous namespace)::ArgEmitter::emitExpanded(swift::Lowering::ArgumentSource&&, swift::Lowering::AbstractionPattern) + 261
43 swift                    0x0000000100e7a9b0 (anonymous namespace)::ArgEmitter::emit(swift::Lowering::ArgumentSource&&, swift::Lowering::AbstractionPattern) + 208
44 swift                    0x0000000100e7a117 (anonymous namespace)::CallSite::emit(swift::Lowering::SILGenFunction&, swift::Lowering::AbstractionPattern, (anonymous namespace)::ParamLowering&, llvm::SmallVectorImpl<swift::Lowering::ManagedValue>&, llvm::SmallVectorImpl<std::__1::pair<swift::Lowering::LValue, swift::SILLocation> >&, llvm::Optional<swift::ForeignErrorConvention> const&, swift::ImportAsMemberStatus const&) && + 455
45 swift                    0x0000000100e6c76e (anonymous namespace)::CallEmission::apply(swift::Lowering::SGFContext) + 3886
46 swift                    0x0000000100e6b1b3 swift::Lowering::SILGenFunction::emitApplyExpr(swift::Expr*, swift::Lowering::SGFContext) + 51
47 swift                    0x0000000100e9fd13 swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 83
48 swift                    0x0000000100ea2dcd swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 12557
49 swift                    0x0000000100e9bca6 swift::Lowering::SILGenFunction::emitRValue(swift::Expr*, swift::Lowering::SGFContext) + 22
50 swift                    0x0000000100e7ad0d (anonymous namespace)::ArgEmitter::emit(swift::Lowering::ArgumentSource&&, swift::Lowering::AbstractionPattern) + 1069
51 swift                    0x0000000100e7a117 (anonymous namespace)::CallSite::emit(swift::Lowering::SILGenFunction&, swift::Lowering::AbstractionPattern, (anonymous namespace)::ParamLowering&, llvm::SmallVectorImpl<swift::Lowering::ManagedValue>&, llvm::SmallVectorImpl<std::__1::pair<swift::Lowering::LValue, swift::SILLocation> >&, llvm::Optional<swift::ForeignErrorConvention> const&, swift::ImportAsMemberStatus const&) && + 455
52 swift                    0x0000000100e6c76e (anonymous namespace)::CallEmission::apply(swift::Lowering::SGFContext) + 3886
53 swift                    0x0000000100e6b1b3 swift::Lowering::SILGenFunction::emitApplyExpr(swift::Expr*, swift::Lowering::SGFContext) + 51
54 swift                    0x0000000100e9fd13 swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 83
55 swift                    0x0000000100e9bca6 swift::Lowering::SILGenFunction::emitRValue(swift::Expr*, swift::Lowering::SGFContext) + 22
56 swift                    0x0000000100e8fb9c swift::Lowering::SILGenFunction::emitStmtCondition(llvm::MutableArrayRef<swift::StmtConditionElement>, swift::Lowering::JumpDest, swift::SILLocation) + 732
57 swift                    0x0000000100ee530a swift::ASTVisitor<(anonymous namespace)::StmtEmitter, void, void, void, void, void, void>::visit(swift::Stmt*) + 6266
58 swift                    0x0000000100ee46d1 swift::ASTVisitor<(anonymous namespace)::StmtEmitter, void, void, void, void, void, void>::visit(swift::Stmt*) + 3137
59 swift                    0x0000000100ee3a85 swift::Lowering::SILGenFunction::emitStmt(swift::Stmt*) + 21
60 swift                    0x0000000100eafc25 swift::Lowering::SILGenFunction::emitFunction(swift::FuncDecl*) + 309
61 swift                    0x0000000100e67296 swift::Lowering::SILGenModule::emitFunction(swift::FuncDecl*)::$_1::operator()(swift::SILFunction*) const + 198
62 swift                    0x0000000100e5fc82 swift::Lowering::SILGenModule::emitFunction(swift::FuncDecl*) + 610
63 swift                    0x0000000100ee89d5 (anonymous namespace)::SILGenType::emitType() + 1013
64 swift                    0x0000000100ee856e swift::Lowering::SILGenModule::visitNominalTypeDecl(swift::NominalTypeDecl*) + 30
65 swift                    0x0000000100e6475b swift::Lowering::SILGenModule::emitSourceFile(swift::SourceFile*, unsigned int) + 747
66 swift                    0x0000000100e653f2 swift::SILModule::constructSIL(swift::ModuleDecl*, swift::SILOptions&, swift::FileUnit*, llvm::Optional<unsigned int>, bool, bool) + 898
67 swift                    0x0000000100e65796 swift::performSILGeneration(swift::ModuleDecl*, swift::SILOptions&, bool, bool) + 38
68 swift                    0x0000000100d36b0f performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*) + 11327
69 swift                    0x0000000100d32fc2 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2898
70 swift                    0x0000000100d01014 main + 2884
71 libdyld.dylib            0x00007fffbeccb255 start + 1
Stack dump:
0.  Program arguments: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -interpret CrashExample.swift -target x86_64-apple-macosx10.9 -enable-objc-interop -sdk /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -color-diagnostics -module-name CrashExample 
1.  While emitting SIL for 'isEqual' at CrashExample.swift:8:21
Segmentation fault: 11

@slavapestov
Copy link
Contributor

Seems to work on 3.0 and master.

@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 itself crash Bug: A crash, i.e., an abnormal termination of software SILGen Area → compiler: The SIL generation stage
Projects
None yet
Development

No branches or pull requests

3 participants