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 3, 2018
· 3 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
There is Segmentation fault: 11 compiler crash while emitting SIL for a function containing a cyclic declaration between a guard statement and un let, for instance:
func foo() {
guard let a = b else { return }
let b = a
}
Here is the complete stack trace of the swift foo.swift command:
Thomas:~$ swift foo.swift
0 swift 0x000000010ad2affa PrintStackTraceSignalHandler(void*) + 42
1 swift 0x000000010ad2a3b6 SignalHandler(int) + 966
2 libsystem_platform.dylib 0x00007fff77a1df5a _sigtramp + 26
3 libsystem_platform.dylib 0x000000000a12a81e _sigtramp + 2456864990
4 swift 0x0000000108701aaf swift::NominalTypeDecl::hasFixedLayout(swift::ModuleDecl*, swift::ResilienceExpansion) const + 31
5 swift 0x000000010822b3e1 (anonymous namespace)::LowerType::visitAnyStructType(swift::CanType, swift::StructDecl*) + 49
6 swift 0x0000000108229c2f swift::Lowering::TypeConverter::getTypeLowering(swift::Lowering::AbstractionPattern, swift::Type) + 3743
7 swift 0x0000000107c9510d swift::Lowering::SILGenFunction::emitInitializationForVarDecl(swift::VarDecl*, bool) + 1773
8 swift 0x0000000107c97768 swift::ASTVisitor<(anonymous namespace)::InitializationForPattern, void, void, void, std::__1::unique_ptr<swift::Lowering::Initialization, std::__1::default_delete<swift::Lowering::Initialization> >, void, void>::visit(swift::Pattern*) + 360
9 swift 0x0000000107c99a8d swift::Lowering::SILGenFunction::emitStmtCondition(llvm::MutableArrayRef<swift::StmtConditionElement>, swift::Lowering::JumpDest, swift::SILLocation, swift::ProfileCounter, swift::ProfileCounter) + 845
10 swift 0x0000000107d17634 swift::ASTVisitor<(anonymous namespace)::StmtEmitter, void, void, void, void, void, void>::visit(swift::Stmt*) + 15732
11 swift 0x0000000107d15218 swift::ASTVisitor<(anonymous namespace)::StmtEmitter, void, void, void, void, void, void>::visit(swift::Stmt*) + 6488
12 swift 0x0000000107cd16cb swift::Lowering::SILGenFunction::emitFunction(swift::FuncDecl*) + 379
13 swift 0x0000000107c398c5 swift::Lowering::SILGenModule::emitFunction(swift::FuncDecl*)::$_1::operator()(swift::SILFunction*) const + 565
14 swift 0x0000000107c38cb5 swift::Lowering::SILGenModule::emitFunction(swift::FuncDecl*) + 741
15 swift 0x0000000107c41cdb swift::Lowering::SILGenModule::emitSourceFile(swift::SourceFile*, unsigned int) + 1371
16 swift 0x0000000107c43b32 swift::SILModule::constructSIL(swift::ModuleDecl*, swift::SILOptions&, swift::FileUnit*, llvm::Optional<unsigned int>, bool) + 1490
17 swift 0x000000010738845c performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 27500
18 swift 0x000000010737fe64 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 7908
19 swift 0x00000001073348b5 main + 18917
20 libdyld.dylib 0x00007fff7770f015 start + 1
21 libdyld.dylib 0x000000000000000a start + 2291077110
Stack dump:
0. Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -interpret foo.swift -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -color-diagnostics -module-name foo
1. While emitting SIL for 'foo()' at foo.swift:1:1
2. While silgen emitFunction SIL function "@_T03fooAAyyF".
for 'foo()' at foo.swift:1:1
Segmentation fault: 11
Feel free to ask if you need more details.
Have a good day!
Thomas
The text was updated successfully, but these errors were encountered:
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
Attachment: Download
Environment
Apple Swift version 4.1 (swiftlang-902.0.48 clang-902.0.37.1)
Xcode 9.3 (9E145)
macOS 10.13.4 (17E202)
Additional Detail from JIRA
md5: 8fcced680f2c7d9d52f448773a617e4b
duplicates:
relates to:
Issue Description:
Hello,
There is Segmentation fault: 11 compiler crash while emitting SIL for a function containing a cyclic declaration between a guard statement and un let, for instance:
Here is the complete stack trace of the swift foo.swift command:
Feel free to ask if you need more details.
Have a good day!
Thomas
The text was updated successfully, but these errors were encountered: