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-2542] Crash on invalid during error-handling checking #45147

Open
swift-ci opened this issue Sep 1, 2016 · 3 comments
Open

[SR-2542] Crash on invalid during error-handling checking #45147

swift-ci opened this issue Sep 1, 2016 · 3 comments
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 type checker Area → compiler: Semantic analysis

Comments

@swift-ci
Copy link
Contributor

swift-ci commented Sep 1, 2016

Previous ID SR-2542
Radar None
Original Reporter VladimirS (JIRA User)
Type Bug
Environment

IBM Swift Sandbox
Swift Ver. 3.0 (Aug 30, 2016)
Platform: Linux (x86_64)

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

md5: 5ba253d971969da18030e64aa85311d0

Issue Description:

let a = true
let b = false

func someFuncOne()->Bool { return true }
func someFuncTwo()->Bool { return true }

let result = a && (b) ? someFuncOne() : somefuncTwo()

print(result)
Swift Ver. 3.0 (Aug 30, 2016)
Platform: Linux (x86_64)

ERROR at line 7, col 41: use of unresolved identifier 'somefuncTwo'
let result = a && (b) ? someFuncOne() : somefuncTwo()
                                        ^~~~~~~~~~~
INFO at line 5, col 6: did you mean 'someFuncTwo'?
func someFuncTwo()->Bool { return true }
     ^
swift: /home/buildnode/jenkins/workspace/oss-swift-package-linux-ubuntu-15_10/swift/lib/Sema/TypeCheckError.cpp:420: (anonymous namespace)::Classification (anonymous namespace)::ApplyClassifier::classifyApply(swift::ApplyExpr *): Assertion `args.size() > fnRef.getNumArgumentsForFullApply() && "partial application was throwing?"' failed.
0  swift           0x00000000033f6a38 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1  swift           0x00000000033f5236 llvm::sys::RunSignalHandlers() + 54
2  swift           0x00000000033f7566
3  libpthread.so.0 0x00007f46b59f9d10
4  libc.so.6       0x00007f46b43411c7 gsignal + 55
5  libc.so.6       0x00007f46b4342e2a abort + 362
6  libc.so.6       0x00007f46b433a0bd
7  libc.so.6       0x00007f46b433a172
8  swift           0x0000000000f07c43
9  swift           0x0000000000f0667c
10 swift           0x00000000010960ca
11 swift           0x00000000010919f0
12 swift           0x0000000001093392
13 swift           0x000000000109130e swift::Stmt::walk(swift::ASTWalker&) + 78
14 swift           0x0000000000f06138 swift::TypeChecker::checkTopLevelErrorHandling(swift::TopLevelCodeDecl*) + 88
15 swift           0x0000000000f3d071 swift::TypeChecker::typeCheckTopLevelCodeDecl(swift::TopLevelCodeDecl*) + 209
16 swift           0x0000000000ef802d swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1133
17 swift           0x0000000000c849f9 swift::CompilerInstance::performSema() + 3289
18 swift           0x00000000007df1ef
19 swift           0x00000000007de2c1 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2833
20 swift           0x00000000007a779b main + 2715
21 libc.so.6       0x00007f46b432cac0 __libc_start_main + 240
22 swift           0x00000000007a52a9 _start + 41
Stack dump:
0.  Program arguments: /usr/bin/swift -frontend -c -primary-file /swift-execution/Sources/main.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -I /swift-execution/.build/debug -enable-testing -g -module-cache-path /swift-execution/.build/debug/ModuleCache -D SWIFT_PACKAGE -emit-module-doc-path /swift-execution/.build/debug/TempCode.build/main~partial.swiftdoc -Onone -module-name TempCode -emit-module-path /swift-execution/.build/debug/TempCode.build/main~partial.swiftmodule -emit-dependencies-path /swift-execution/.build/debug/TempCode.build/main.d -emit-reference-dependencies-path /swift-execution/.build/debug/TempCode.build/main.swiftdeps -num-threads 8 -o /swift-execution/.build/debug/TempCode.build/main.swift.o 
1.  While walking into initializer for declaration 0x6360728 at /swift-execution/Sources/main.swift:7:1
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
@belkadan
Copy link
Contributor

belkadan commented Sep 1, 2016

   Assertion failed: (args.size() > fnRef.getNumArgumentsForFullApply() && "partial application was throwing?"), function classifyApply, file /Volumes/Data/swift-public/swift/lib/Sema/TypeCheckError.cpp, line 420.
0  swift                    0x000000010dced70b llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 43
1  swift                    0x000000010dcec956 llvm::sys::RunSignalHandlers() + 70
2  swift                    0x000000010dcede5f SignalHandler(int) + 383
3  libsystem_platform.dylib 0x00007fffc5f79bba _sigtramp + 26
4  libsystem_platform.dylib 0x000000011559ea77 _sigtramp + 1331842775
5  swift                    0x000000010dcedbae abort + 14
6  swift                    0x000000010dcedb91 __assert_rtn + 81
7  swift                    0x000000010b7c56e5 (anonymous namespace)::ApplyClassifier::classifyApply(swift::ApplyExpr*) + 1125
8  swift                    0x000000010b7c4784 (anonymous namespace)::ErrorHandlingWalker<(anonymous namespace)::CheckErrorCoverage>::walkToExprPre(swift::Expr*) + 276
9  swift                    0x000000010b886212 swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Expr*) + 8050

@belkadan
Copy link
Contributor

belkadan commented Sep 1, 2016

Possibly related to your other SR-2539; we might just not be recovering from bad ternary expressions.

@swift-ci
Copy link
Contributor Author

swift-ci commented Apr 3, 2017

Comment by Vladimir (JIRA)

Still the same for Swift 3.1

@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 itself crash Bug: A crash, i.e., an abnormal termination of software type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

3 participants