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-6540] swiftc Crash #49090

Closed
Frizlab opened this issue Dec 5, 2017 · 5 comments
Closed

[SR-6540] swiftc Crash #49090

Frizlab opened this issue Dec 5, 2017 · 5 comments
Assignees
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

@Frizlab
Copy link

Frizlab commented Dec 5, 2017

Previous ID SR-6540
Radar rdar://problem/35870863
Original Reporter @Frizlab
Type Bug
Status Resolved
Resolution Done
Environment

Xcode 9.2 (9C40b) on macOS Sierra (16G1036)

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, CompilerCrash
Assignee @Frizlab
Priority Medium

md5: 5ed879bcd47f874eddd36d0a93bfec9a

is duplicated by:

  • SR-6541 Swift Compiler Fills Memory Until Computer Crashes

Issue Description:

Try and compile the following Swift source:

struct Container {let string = "yes"}
let optionalContainer: Container? = Container()
let optionalString: String? = "toto"

switch optionalString {
case optionalContainer?.string?: ()
default: ()
}

The compiler crashes with a segfault.

@Frizlab
Copy link
Author

Frizlab commented Dec 5, 2017

Most probably related to SR-6541

@slavapestov
Copy link
Member

@swift-ci create

@slavapestov
Copy link
Member

BindOptional expression is out of its depth
(bind_optional_expr type='Container' location=cr.swift:5:23 range=[cr.swift:5:6 - line:5:23] depth=0
(declref_expr type='Container?' location=cr.swift:5:6 range=[cr.swift:5:6 - line:5:6] decl=cr.(file).optionalContainer@cr.swift:2:5 direct_to_storage function_ref=unapplied))0  swift                    0x00000001108c4d28 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1  swift                    0x00000001108c53e6 SignalHandler(int) + 470
2  libsystem_platform.dylib 0x00007fff59989f5a _sigtramp + 26
3  swift                    0x00000001114fe828 (anonymous namespace)::DarwinX86AsmBackend::getCompactUnwindRegNum(unsigned int) const::CU64BitRegs + 222898
4  libsystem_c.dylib        0x00007fff597b532a abort + 127
5  swift                    0x000000010e2f78f3 (anonymous namespace)::Verifier::walkToExprPost(swift::Expr*) + 14563
6  swift                    0x000000010e30607e swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Expr*) + 1870
7  swift                    0x000000010e306204 swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Expr*) + 2260
8  swift                    0x000000010e309963 (anonymous namespace)::Traversal::visitApplyExpr(swift::ApplyExpr*) + 211
9  swift                    0x000000010e309a8b (anonymous namespace)::Traversal::visitSelfApplyExpr(swift::SelfApplyExpr*) + 91
10 swift                    0x000000010e3098e6 (anonymous namespace)::Traversal::visitApplyExpr(swift::ApplyExpr*) + 86
11 swift                    0x000000010e30b157 (anonymous namespace)::Traversal::visit(swift::Pattern*) + 1015
12 swift                    0x000000010e30b0e2 (anonymous namespace)::Traversal::visit(swift::Pattern*) + 898
13 swift                    0x000000010e30a284 swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Stmt*) + 1748
14 swift                    0x000000010e30a1a8 swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Stmt*) + 1528
15 swift                    0x000000010e309c90 swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Stmt*) + 224
16 swift                    0x000000010e305355 (anonymous namespace)::Traversal::doIt(swift::Decl*) + 1381
17 swift                    0x000000010e304ddb swift::Decl::walk(swift::ASTWalker&) + 27
18 swift                    0x000000010e3a00ea swift::SourceFile::walk(swift::ASTWalker&) + 170
19 swift                    0x000000010e2f32eb swift::verify(swift::SourceFile&) + 59
20 swift                    0x000000010e0da04f swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int, unsigned int, unsigned int) + 1999
21 swift                    0x000000010dd66533 swift::CompilerInstance::parseAndTypeCheckMainFile(swift::PersistentParserState&, swift::DelayedParsingCallbacks*, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>) + 435
22 swift                    0x000000010dd653ec swift::CompilerInstance::parseAndCheckTypes(swift::CompilerInstance::ImplicitImports const&) + 764
23 swift                    0x000000010dd64b74 swift::CompilerInstance::performSema() + 532
24 swift                    0x000000010d2561c5 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 1781
25 swift                    0x000000010d254b0a swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3210
26 swift                    0x000000010d2159b0 main + 3360
27 libdyld.dylib            0x00007fff59709145 start + 1

@xedin
Copy link
Member

xedin commented Feb 23, 2018

PR #14798 should address this and it's merged into master. Thanks for reporting @Frizlab! Please use next available nightly build to verify.

@Frizlab
Copy link
Author

Frizlab commented Feb 25, 2018

@xedin Tested with latest nightly, no problem with compilation. SourceKit still crashes when code is put inside a Playground. No problems at all when run in a normal Command Line project.

@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 in itself crash Bug: A crash, i.e., an abnormal termination of software
Projects
None yet
Development

No branches or pull requests

4 participants