You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
swift-ci opened this issue
May 5, 2020
· 5 comments
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler in itselfcrashBug: A crash, i.e., an abnormal termination of software
I would love to, but I'm in a "don't mess with your system" situation for the next month or so. It's a simple test case, so it should be obvious if it no longer crashes.
No problem plinth666 (JIRA User)
Quick tip, you are able to test snippets in the lastest snapshot without installing it in compiler explorer https://godbolt.org 🙂
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler in itselfcrashBug: A crash, i.e., an abnormal termination of software
Additional Detail from JIRA
md5: eb3436810df2c2d5e0c7f6e5466dcd39
Issue Description:
*public* *protocol* Id {
*subscript* (a:Int ) -> Self { ``*get*
}``}
*public* *func* foob(a:Id) {
print (a[3])
``}
Compiling this causes a segfault in the compiler:
Stack dump:``0. Program arguments: /Applications/Xcode_10.2.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -primary-file /Users/steveh/Projects/BadAssociations/BadAssociations/main.swift -emit-module-path /Users/steveh/Library/Developer/Xcode/DerivedData/BadAssociations-cudzyhoifmppqghaaoysmfagihcp/Build/Intermediates.noindex/BadAssociations.build/Debug/BadAssociations.build/Objects-normal/x86_64/main~partial.swiftmodule -emit-module-doc-path /Users/steveh/Library/Developer/Xcode/DerivedData/BadAssociations-cudzyhoifmppqghaaoysmfagihcp/Build/Intermediates.noindex/BadAssociations.build/Debug/BadAssociations.build/Objects-normal/x86_64/main~partial.swiftdoc -serialize-diagnostics-path /Users/steveh/Library/Developer/Xcode/DerivedData/BadAssociations-cudzyhoifmppqghaaoysmfagihcp/Build/Intermediates.noindex/BadAssociations.build/Debug/BadAssociations.build/Objects-normal/x86_64/main.dia -emit-dependencies-path /Users/steveh/Library/Developer/Xcode/DerivedData/BadAssociations-cudzyhoifmppqghaaoysmfagihcp/Build/Intermediates.noindex/BadAssociations.build/Debug/BadAssociations.build/Objects-normal/x86_64/main.d -emit-reference-dependencies-path /Users/steveh/Library/Developer/Xcode/DerivedData/BadAssociations-cudzyhoifmppqghaaoysmfagihcp/Build/Intermediates.noindex/BadAssociations.build/Debug/BadAssociations.build/Objects-normal/x86_64/main.swiftdeps -target x86_64-apple-macosx10.14 -enable-objc-interop -sdk /Applications/Xcode_10.2.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I /Users/steveh/Library/Developer/Xcode/DerivedData/BadAssociations-cudzyhoifmppqghaaoysmfagihcp/Build/Products/Debug -F /Users/steveh/Library/Developer/Xcode/DerivedData/BadAssociations-cudzyhoifmppqghaaoysmfagihcp/Build/Products/Debug -enable-testing -g -module-cache-path /Users/steveh/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -swift-version 5 -enforce-exclusivity=checked -Onone -D DEBUG -serialize-debugging-options -Xcc -working-directory -Xcc /Users/steveh/Projects/BadAssociations -enable-anonymous-context-mangled-names -Xcc -I/Users/steveh/Library/Developer/Xcode/DerivedData/BadAssociations-cudzyhoifmppqghaaoysmfagihcp/Build/Intermediates.noindex/BadAssociations.build/Debug/BadAssociations.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/steveh/Library/Developer/Xcode/DerivedData/BadAssociations-cudzyhoifmppqghaaoysmfagihcp/Build/Intermediates.noindex/BadAssociations.build/Debug/BadAssociations.build/BadAssociations-generated-files.hmap -Xcc -I/Users/steveh/Library/Developer/Xcode/DerivedData/BadAssociations-cudzyhoifmppqghaaoysmfagihcp/Build/Intermediates.noindex/BadAssociations.build/Debug/BadAssociations.build/BadAssociations-own-target-headers.hmap -Xcc -I/Users/steveh/Library/Developer/Xcode/DerivedData/BadAssociations-cudzyhoifmppqghaaoysmfagihcp/Build/Intermediates.noindex/BadAssociations.build/Debug/BadAssociations.build/BadAssociations-all-target-headers.hmap -Xcc -iquote -Xcc /Users/steveh/Library/Developer/Xcode/DerivedData/BadAssociations-cudzyhoifmppqghaaoysmfagihcp/Build/Intermediates.noindex/BadAssociations.build/Debug/BadAssociations.build/BadAssociations-project-headers.hmap -Xcc -I/Users/steveh/Library/Developer/Xcode/DerivedData/BadAssociations-cudzyhoifmppqghaaoysmfagihcp/Build/Products/Debug/include -Xcc -I/Users/steveh/Library/Developer/Xcode/DerivedData/BadAssociations-cudzyhoifmppqghaaoysmfagihcp/Build/Intermediates.noindex/BadAssociations.build/Debug/BadAssociations.build/DerivedSources-normal/x86_64 -Xcc -I/Users/steveh/Library/Developer/Xcode/DerivedData/BadAssociations-cudzyhoifmppqghaaoysmfagihcp/Build/Intermediates.noindex/BadAssociations.build/Debug/BadAssociations.build/DerivedSources/x86_64 -Xcc -I/Users/steveh/Library/Developer/Xcode/DerivedData/BadAssociations-cudzyhoifmppqghaaoysmfagihcp/Build/Intermediates.noindex/BadAssociations.build/Debug/BadAssociations.build/DerivedSources -Xcc -DDEBUG=1 -module-name BadAssociations -o /Users/steveh/Library/Developer/Xcode/DerivedData/BadAssociations-cudzyhoifmppqghaaoysmfagihcp/Build/Intermediates.noindex/BadAssociations.build/Debug/BadAssociations.build/Objects-normal/x86_64/main.o -index-store-path /Users/steveh/Library/Developer/Xcode/DerivedData/BadAssociations-cudzyhoifmppqghaaoysmfagihcp/Index/DataStore -index-system-modules ``1. While emitting SIL for 'foob(a:)' (at /Users/steveh/Projects/BadAssociations/BadAssociations/main.swift:39:8)``2. While silgen emitFunction SIL function "@$s15BadAssociations4foob1ayAA2Id_p_tF".`` for 'foob(a:)' (at /Users/steveh/Projects/BadAssociations/BadAssociations/main.swift:39:8)``0 swift 0x00000001082c9ee3 PrintStackTraceSignalHandler(void*) + 51``1 swift 0x00000001082c96bc SignalHandler(int) + 348``2 libsystem_platform.dylib 0x00007fff7c9aeb5d _sigtramp + 29``3 libsystem_platform.dylib 0x00007fb84d00d7d8 _sigtramp + 3496340632
4 swift 0x0000000104cdea9b (anonymous namespace)::ExistentialInitialization::getAddressForInPlaceInitialization(swift::Lowering::SILGenFunction&, swift::SILLocation) + 587
5 swift 0x0000000104c96951 swift::Lowering::SingleBufferInitialization::copyOrInitValueInto(swift::Lowering::SILGenFunction&, swift::SILLocation, swift::Lowering::ManagedValue, bool) + 49
6 swift 0x0000000104cf9e61 swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 31921
7 swift 0x0000000104d5f251 swift::Lowering::SILGenFunction::emitRValueAsOrig(swift::Expr*, swift::Lowering::AbstractionPattern, swift::Lowering::TypeLowering const&, swift::Lowering::SGFContext) + 529
8 swift 0x0000000104d09d25 swift::Lowering::ManagedValue llvm::function_ref<swift::Lowering::ManagedValue (swift::Lowering::SGFContext)>::callback_fn<(anonymous namespace)::RValueEmitter::visitErasureExpr(swift::ErasureExpr*, swift::Lowering::SGFContext)::$_9>(long, swift::Lowering::SGFContext) + 101
9 swift 0x0000000104cde4de void llvm::function_ref<void (swift::SILValue)>::callback_fn<swift::Lowering::SILGenFunction::emitExistentialErasure(swift::SILLocation, swift::CanType, swift::Lowering::TypeLowering const&, swift::Lowering::TypeLowering const&, llvm::ArrayRefswift::ProtocolConformanceRef, swift::Lowering::SGFContext, llvm::function_ref<swift::Lowering::ManagedValue (swift::Lowering::SGFContext)>, bool)::$_6>(long, swift::SILValue) + 430
10 swift 0x0000000104cc0e14 swift::Lowering::SILGenBuilder::bufferForExpr(swift::SILLocation, swift::SILType, swift::Lowering::TypeLowering const&, swift::Lowering::SGFContext, llvm::function_ref<void (swift::SILValue)>) + 148
11 swift 0x0000000104cdcbea swift::Lowering::SILGenFunction::emitExistentialErasure(swift::SILLocation, swift::CanType, swift::Lowering::TypeLowering const&, swift::Lowering::TypeLowering const&, llvm::ArrayRefswift::ProtocolConformanceRef, swift::Lowering::SGFContext, llvm::function_ref<swift::Lowering::ManagedValue (swift::Lowering::SGFContext)>, bool) + 2650
12 swift 0x0000000104cfae56 swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 36006
13 swift 0x0000000104d08d49 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)::$_16>(swift::OpenExistentialExpr*, (anonymous namespace)::RValueEmitter::visitOpenExistentialExpr(swift::OpenExistentialExpr*, swift::Lowering::SGFContext)::$_16)::'lambda'(swift::Expr*)>(long, swift::Expr*) + 41
14 swift 0x0000000104d091ab swift::Lowering::SILGenFunction::emitOpenExistentialExprImpl(swift::OpenExistentialExpr*, llvm::function_ref<void (swift::Expr*)>) + 1003
15 swift 0x0000000104cf9edb swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 32043
16 swift 0x0000000104cf1fd3 swift::Lowering::SILGenFunction::emitExprInto(swift::Expr*, swift::Lowering::Initialization*, llvm::Optionalswift::SILLocation) + 131
17 swift 0x0000000104c6964f swift::Lowering::ArgumentSource::forwardInto(swift::Lowering::SILGenFunction&, swift::Lowering::AbstractionPattern, swift::Lowering::Initialization*, swift::Lowering::TypeLowering const&) && + 527
18 swift 0x0000000104c8ec91 (anonymous namespace)::ArgEmitter::emit(swift::Lowering::ArgumentSource&&, swift::Lowering::AbstractionPattern) + 3457
19 swift 0x0000000104ca26fa (anonymous namespace)::ArgEmitter::emitTopLevel(swift::Lowering::ArgumentSource&&, swift::Lowering::AbstractionPattern) + 7722
20 swift 0x0000000104ca067a (anonymous namespace)::CallSite::emit(swift::Lowering::SILGenFunction&, swift::Lowering::AbstractionPattern, swift::CanTypeWrapperswift::SILFunctionType, (anonymous namespace)::ParamLowering&, llvm::SmallVectorImplswift::Lowering::ManagedValue&, llvm::SmallVectorImpl<(anonymous namespace)::DelayedArgument>&, llvm::Optionalswift::ForeignErrorConvention const&, swift::ImportAsMemberStatus) && + 714
21 swift 0x0000000104c9d99b (anonymous namespace)::CallEmission::emitArgumentsForNormalApply(swift::CanTypeWrapperswift::FunctionType&, swift::Lowering::AbstractionPattern&, swift::CanTypeWrapperswift::SILFunctionType, llvm::Optionalswift::ForeignErrorConvention const&, swift::ImportAsMemberStatus, llvm::SmallVectorImplswift::Lowering::ManagedValue&, llvm::Optionalswift::SILLocation&, swift::CanTypeWrapperswift::FunctionType&) + 1467
22 swift 0x0000000104c9b398 (anonymous namespace)::CallEmission::apply(swift::Lowering::SGFContext) + 2792
23 swift 0x0000000104c974bb swift::Lowering::SILGenFunction::emitApplyExpr(swift::Expr*, swift::Lowering::SGFContext) + 2331
24 swift 0x0000000104d0a82b swift::Lowering::SILGenFunction::emitIgnoredExpr(swift::Expr*) + 811
25 swift 0x0000000104d68313 swift::ASTVisitor<(anonymous namespace)::StmtEmitter, void, void, void, void, void, void>::visit(swift::Stmt*) + 8371
26 swift 0x0000000104d1eb41 swift::Lowering::SILGenFunction::emitFunction(swift::FuncDecl*) + 433
27 swift 0x0000000104c7c4d3 swift::Lowering::SILGenModule::emitFunction(swift::FuncDecl*) + 995
28 swift 0x0000000104c86856 swift::Lowering::SILGenModule::emitSourceFile(swift::SourceFile*) + 1206
29 swift 0x0000000104c8866c swift::SILModule::constructSIL(swift::ModuleDecl*, swift::SILOptions&, swift::FileUnit*) + 1228
30 swift 0x00000001041297aa performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 30122
31 swift 0x000000010411e92e swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 6862
32 swift 0x00000001040bc9ce main + 1246
33 libdyld.dylib 0x00007fff7c7c33d5 start + 1
error: Segmentation fault: 11
The text was updated successfully, but these errors were encountered: