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-3907] Crash when "no calls to throwing functions occur within 'try' expression" #46492

Open
ankitspd opened this issue Feb 9, 2017 · 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 SILGen Area → compiler: The SIL generation stage

Comments

@ankitspd
Copy link
Member

ankitspd commented Feb 9, 2017

Previous ID SR-3907
Radar None
Original Reporter @aciidb0mb3r
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, CompilerCrash, SILGen
Assignee None
Priority Medium

md5: 042e5c10f1911009e5c6d5954f94ccb8

Issue Description:

This code is wrong but crashes the compiler:

struct Version {
    init?() { }

    func convertTagsToVersionMap() {
        if let _ = try? Version() { }
        if [""].isEmpty { return }
    }
}
$ swiftc Git.swift
Git.swift:5:25: warning: no calls to throwing functions occur within 'try' expression
        if let _ = try? Version() { }
                        ^
0  swift                    0x00000001076c6b47 PrintStackTraceSignalHandler(void*) + 39
1  swift                    0x00000001076c5ff6 SignalHandler(int) + 646
2  libsystem_platform.dylib 0x00007fffd09cbb3a _sigtramp + 26
3  libsystem_platform.dylib 000000000000000000 _sigtramp + 795034848
4  swift                    0x0000000104d2e326 swift::Lowering::SILGenFunction::emitEpilog(swift::SILLocation, bool) + 86
5  swift                    0x0000000104d4b894 swift::Lowering::SILGenFunction::emitFunction(swift::FuncDecl*) + 468
6  swift                    0x0000000104cccc0b swift::Lowering::SILGenModule::emitFunction(swift::FuncDecl*)::$_1::operator()(swift::SILFunction*) const + 1867
7  swift                    0x0000000104ccb7e2 swift::Lowering::SILGenModule::emitFunction(swift::FuncDecl*) + 642
8  swift                    0x0000000104d9115b (anonymous namespace)::SILGenType::emitType() + 971
9  swift                    0x0000000104d90d2d swift::Lowering::SILGenModule::visitNominalTypeDecl(swift::NominalTypeDecl*) + 29
10 swift                    0x0000000104cd921b swift::Lowering::SILGenModule::emitSourceFile(swift::SourceFile*, unsigned int) + 1483
11 swift                    0x0000000104cdadf9 swift::SILModule::constructSIL(swift::ModuleDecl*, swift::SILOptions&, swift::FileUnit*, llvm::Optional<unsigned int>, bool, bool) + 1593
12 swift                    0x00000001044ecfc2 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 42402
13 swift                    0x000000010449c81c main + 9052
14 libdyld.dylib            0x00007fffd07bc235 start + 1
15 libdyld.dylib            0x000000000000000f start + 797195739
Stack dump:
0.  Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -primary-file Git.swift -target x86_64-apple-macosx10.9 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -color-diagnostics -module-name Git -o /var/folders/98/0fcj8gms75z3x7_01g5v_m0h0000gn/T/Git-e72817.o
1.  While emitting SIL for 'convertTagsToVersionMap' at Git.swift:4:5
<unknown>:0: error: unable to execute command: Segmentation fault: 11
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
@swift-ci
Copy link
Collaborator

swift-ci commented Mar 7, 2017

Comment by Pawel Szot (JIRA)

Seems like a duplicate: https://bugs.swift.org/browse/SR-1333

@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
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 SILGen Area → compiler: The SIL generation stage
Projects
None yet
Development

No branches or pull requests

3 participants