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-2288] 8/4 Snapshot Assertion Failure #44895

Closed
saagarjha opened this issue Aug 5, 2016 · 3 comments
Closed

[SR-2288] 8/4 Snapshot Assertion Failure #44895

saagarjha opened this issue Aug 5, 2016 · 3 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 regression swift 3.0 type checker Area → compiler: Semantic analysis

Comments

@saagarjha
Copy link
Contributor

Previous ID SR-2288
Radar rdar://problem/27815848
Original Reporter @saagarjha
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Environment

macOS Sierra 10.12 Beta (16A270f)
Xcode Version 8.0 beta 4 (8S188o)
Toolchain: Swift Development Snapshot 2016-08-04 (a)

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

md5: 323b6f2310c359a0ed5e0e9fec3f55ea

is duplicated by:

  • SR-2349 Segfault while type-checking expression in which [AnyHashable: Any] cannot be converted to [String: String]
  • SR-2367 Swift 3 (Xcode 8 beta 6) type-checking crash

relates to:

  • SR-2349 Segfault while type-checking expression in which [AnyHashable: Any] cannot be converted to [String: String]

Issue Description:

The compiler appears to hang up on some watchOS code I built the other day:

Assertion failed: (value != OpenExistentials.end() && "didn't see this OVE in a containing OpenExistentialExpr?"), function walkToExprPre, file /Users/buildnode/jenkins/workspace/oss-swift-package-osx/swift/lib/Sema/CSDiag.cpp, line 3082.
0  swift                    0x0000000111a06ebb llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 43
1  swift                    0x0000000111a06106 llvm::sys::RunSignalHandlers() + 70
2  swift                    0x0000000111a0760f SignalHandler(int) + 383
3  libsystem_platform.dylib 0x00007fffa6122d7a _sigtramp + 26
4  libsystem_platform.dylib 0x0000000000001e88 _sigtramp + 1508765992
5  swift                    0x0000000111a0735e abort + 14
6  swift                    0x0000000111a07341 __assert_rtn + 81
7  swift                    0x000000010f505879 eraseOpenedExistentials(swift::Expr*&)::ExistentialEraser::walkToExprPre(swift::Expr*) + 361
8  swift                    0x000000010f68cea5 (anonymous namespace)::Traversal::visit(swift::Expr*) + 4981
9  swift                    0x000000010f68af75 swift::Expr::walk(swift::ASTWalker&) + 53
10 swift                    0x000000010f502375 (anonymous namespace)::FailureDiagnosis::typeCheckChildIndependently(swift::Expr*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<TCCFlags, unsigned int>, swift::ExprTypeCheckListener*) + 1221
11 swift                    0x000000010f508ea3 (anonymous namespace)::FailureDiagnosis::typeCheckArgumentChildIndependently(swift::Expr*, swift::Type, (anonymous namespace)::CalleeCandidateInfo const&, swift::OptionSet<TCCFlags, unsigned int>) + 1987
12 swift                    0x000000010f5129a1 (anonymous namespace)::FailureDiagnosis::visitApplyExpr(swift::ApplyExpr*) + 913
13 swift                    0x000000010f4fcf6a swift::ASTVisitor<(anonymous namespace)::FailureDiagnosis, bool, void, void, void, void, void>::visit(swift::Expr*) + 170
14 swift                    0x000000010f4f6888 swift::constraints::ConstraintSystem::diagnoseFailureForExpr(swift::Expr*) + 104
15 swift                    0x000000010f4fc9a8 swift::constraints::ConstraintSystem::salvage(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::Expr*) + 4056
16 swift                    0x000000010f57f665 swift::TypeChecker::solveForExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::FreeTypeVariableBinding, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem&, llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>) + 917
17 swift                    0x000000010f5857d1 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem*) + 625
18 swift                    0x000000010f600061 swift::ASTVisitor<(anonymous namespace)::StmtChecker, void, swift::Stmt*, void, void, void, void>::visit(swift::Stmt*) + 545
19 swift                    0x000000010f600543 swift::ASTVisitor<(anonymous namespace)::StmtChecker, void, swift::Stmt*, void, void, void, void>::visit(swift::Stmt*) + 1795
20 swift                    0x000000010f5fff8e swift::ASTVisitor<(anonymous namespace)::StmtChecker, void, swift::Stmt*, void, void, void, void>::visit(swift::Stmt*) + 334
21 swift                    0x000000010f5ff369 (anonymous namespace)::StmtChecker::typeCheckBody(swift::BraceStmt*&) + 25
22 swift                    0x000000010f5fe63f swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) + 383
23 swift                    0x000000010f5fe463 swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 35
24 swift                    0x000000010f5fefe4 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 180
25 swift                    0x000000010f5b9c56 typeCheckFunctionsAndExternalDecls(swift::TypeChecker&) + 166
26 swift                    0x000000010f5ba8f0 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1568
27 swift                    0x000000010f25b98c swift::CompilerInstance::performSema() + 3916
28 swift                    0x000000010ed56ad1 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*) + 449
29 swift                    0x000000010ed5563f swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2895
30 swift                    0x000000010ed17ea0 main + 2448
31 libdyld.dylib            0x00007fffa5f16255 start + 1
32 libdyld.dylib            0x0000000000000040 start + 1510907372
Stack dump:
0.  Program arguments: /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2016-08-04-a.xctoolchain/usr/bin/swift -frontend -c /Users/saagarjha/Xcode Projects/SwiftCompilerTest/SwiftCompilerTest WatchKit Extension/NotificationController.swift /Users/saagarjha/Xcode Projects/SwiftCompilerTest/SwiftCompilerTest WatchKit Extension/ComplicationController.swift /Users/saagarjha/Xcode Projects/SwiftCompilerTest/SwiftCompilerTest WatchKit Extension/ExtensionDelegate.swift -primary-file /Users/saagarjha/Xcode Projects/SwiftCompilerTest/SwiftCompilerTest WatchKit Extension/InterfaceController.swift -target i386-apple-watchos3.0 -enable-objc-interop -sdk /Applications/Xcode-beta.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator3.0.sdk -I /Users/saagarjha/Library/Developer/Xcode/DerivedData/SwiftCompilerTest-hidbwzcydzdjttcebnadpgszbkxt/Build/Products/Debug-watchsimulator -F /Users/saagarjha/Library/Developer/Xcode/DerivedData/SwiftCompilerTest-hidbwzcydzdjttcebnadpgszbkxt/Build/Products/Debug-watchsimulator -application-extension -enable-testing -g -module-cache-path /Users/saagarjha/Library/Developer/Xcode/DerivedData/ModuleCache -D DEBUG -serialize-debugging-options -Xcc -I/Users/saagarjha/Library/Developer/Xcode/DerivedData/SwiftCompilerTest-hidbwzcydzdjttcebnadpgszbkxt/Build/Intermediates/SwiftCompilerTest.build/Debug-watchsimulator/SwiftCompilerTest WatchKit Extension.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/saagarjha/Library/Developer/Xcode/DerivedData/SwiftCompilerTest-hidbwzcydzdjttcebnadpgszbkxt/Build/Intermediates/SwiftCompilerTest.build/Debug-watchsimulator/SwiftCompilerTest WatchKit Extension.build/SwiftCompilerTest WatchKit Extension-generated-files.hmap -Xcc -I/Users/saagarjha/Library/Developer/Xcode/DerivedData/SwiftCompilerTest-hidbwzcydzdjttcebnadpgszbkxt/Build/Intermediates/SwiftCompilerTest.build/Debug-watchsimulator/SwiftCompilerTest WatchKit Extension.build/SwiftCompilerTest WatchKit Extension-own-target-headers.hmap -Xcc -I/Users/saagarjha/Library/Developer/Xcode/DerivedData/SwiftCompilerTest-hidbwzcydzdjttcebnadpgszbkxt/Build/Intermediates/SwiftCompilerTest.build/Debug-watchsimulator/SwiftCompilerTest WatchKit Extension.build/SwiftCompilerTest WatchKit Extension-all-target-headers.hmap -Xcc -iquote -Xcc /Users/saagarjha/Library/Developer/Xcode/DerivedData/SwiftCompilerTest-hidbwzcydzdjttcebnadpgszbkxt/Build/Intermediates/SwiftCompilerTest.build/Debug-watchsimulator/SwiftCompilerTest WatchKit Extension.build/SwiftCompilerTest WatchKit Extension-project-headers.hmap -Xcc -I/Users/saagarjha/Library/Developer/Xcode/DerivedData/SwiftCompilerTest-hidbwzcydzdjttcebnadpgszbkxt/Build/Products/Debug-watchsimulator/include -Xcc -I/Users/saagarjha/Library/Developer/Xcode/DerivedData/SwiftCompilerTest-hidbwzcydzdjttcebnadpgszbkxt/Build/Intermediates/SwiftCompilerTest.build/Debug-watchsimulator/SwiftCompilerTest WatchKit Extension.build/DerivedSources/i386 -Xcc -I/Users/saagarjha/Library/Developer/Xcode/DerivedData/SwiftCompilerTest-hidbwzcydzdjttcebnadpgszbkxt/Build/Intermediates/SwiftCompilerTest.build/Debug-watchsimulator/SwiftCompilerTest WatchKit Extension.build/DerivedSources -Xcc -DDEBUG=1 -Xcc -working-directory/Users/saagarjha/Xcode Projects/SwiftCompilerTest -emit-module-doc-path /Users/saagarjha/Library/Developer/Xcode/DerivedData/SwiftCompilerTest-hidbwzcydzdjttcebnadpgszbkxt/Build/Intermediates/SwiftCompilerTest.build/Debug-watchsimulator/SwiftCompilerTest WatchKit Extension.build/Objects-normal/i386/InterfaceController~partial.swiftdoc -Onone -module-name SwiftCompilerTest_WatchKit_Extension -emit-module-path /Users/saagarjha/Library/Developer/Xcode/DerivedData/SwiftCompilerTest-hidbwzcydzdjttcebnadpgszbkxt/Build/Intermediates/SwiftCompilerTest.build/Debug-watchsimulator/SwiftCompilerTest WatchKit Extension.build/Objects-normal/i386/InterfaceController~partial.swiftmodule -serialize-diagnostics-path /Users/saagarjha/Library/Developer/Xcode/DerivedData/SwiftCompilerTest-hidbwzcydzdjttcebnadpgszbkxt/Build/Intermediates/SwiftCompilerTest.build/Debug-watchsimulator/SwiftCompilerTest WatchKit Extension.build/Objects-normal/i386/InterfaceController.dia -emit-dependencies-path /Users/saagarjha/Library/Developer/Xcode/DerivedData/SwiftCompilerTest-hidbwzcydzdjttcebnadpgszbkxt/Build/Intermediates/SwiftCompilerTest.build/Debug-watchsimulator/SwiftCompilerTest WatchKit Extension.build/Objects-normal/i386/InterfaceController.d -emit-reference-dependencies-path /Users/saagarjha/Library/Developer/Xcode/DerivedData/SwiftCompilerTest-hidbwzcydzdjttcebnadpgszbkxt/Build/Intermediates/SwiftCompilerTest.build/Debug-watchsimulator/SwiftCompilerTest WatchKit Extension.build/Objects-normal/i386/InterfaceController.swiftdeps -o /Users/saagarjha/Library/Developer/Xcode/DerivedData/SwiftCompilerTest-hidbwzcydzdjttcebnadpgszbkxt/Build/Intermediates/SwiftCompilerTest.build/Debug-watchsimulator/SwiftCompilerTest WatchKit Extension.build/Objects-normal/i386/InterfaceController.o 
1.  While type-checking 'sendMessage' at /Users/saagarjha/Xcode Projects/SwiftCompilerTest/SwiftCompilerTest WatchKit Extension/InterfaceController.swift:46:2
2.  While type-checking expression at [/Users/saagarjha/Xcode Projects/SwiftCompilerTest/SwiftCompilerTest WatchKit Extension/InterfaceController.swift:48:4 - line:48:87] RangeText="session.sendMessage(message, replyHandler: replyHandler, errorHandler: errorHandler)" }}

I've created a simple Xcode project that creates this issue and uploaded it. The issue appears to occur in sendMessage(_:replyHandler:errorHandler:) in InterfaceController.swift.
I created the project with an iOS app with a WatchKit app, added @escaping and replaced AnyObject with Any to get rid of warnings, and then copied sendMessage(_:replyHandler:errorHandler:) from one of my previous projects, which crashed the compiler.

@belkadan
Copy link
Contributor

belkadan commented Aug 5, 2016

@rudkx, @milseman, does this sound familiar?

@rudkx
Copy link
Member

rudkx commented Aug 16, 2016

Updated the external bug link to one with more information.

We're crashing when we attempt to emit a diagnostic and happen to have a collection conversion in the same expression.

@rjmccall
Copy link
Member

Fixed with #4329

@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 regression swift 3.0 type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

5 participants