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-7551] apply expression is not marked as throwing or non-throwing crash #50093

Closed
keith opened this issue Apr 26, 2018 · 3 comments
Closed
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

@keith
Copy link
Collaborator

keith commented Apr 26, 2018

Previous ID SR-7551
Radar rdar://problem/39860617
Original Reporter @keith
Type Bug
Status Closed
Resolution Duplicate

Attachment: Download

Environment

swift-4.2-DEVELOPMENT-SNAPSHOT-2018-04-23-a
Xcode 9.3

Additional Detail from JIRA
Votes 1
Component/s Compiler
Labels Bug, CompilerCrash
Assignee None
Priority Medium

md5: 910ea6a9ef20b9d8ac4cebe33502049c

duplicates:

  • SR-5427 Crash in generated code when calling optional closure that throws

Issue Description:

With the attached sample project you get this compiler crash:

apply expression is not marked as throwing or non-throwing
(call_expr implicit type='CLLocationCoordinate2D' arg_labels=
  (declref_expr implicit type='() -> CLLocationCoordinate2D' decl=Builtin.(file).zeroInitializer() [with CLLocationCoordinate2D] function_ref=unapplied)
  (tuple_expr implicit type='()'))
0  swift                    0x0000000105f4e938 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1  swift                    0x0000000105f4f046 SignalHandler(int) + 694
2  libsystem_platform.dylib 0x00007fff5c6f8f5a _sigtramp + 26
3  libsystem_platform.dylib 0x00007ffeed4918a8 _sigtramp + 2430175592
4  libsystem_c.dylib        0x00007fff5c4961ae abort + 127
5  swift                    0x000000010393b853 (anonymous namespace)::Verifier::verifyChecked(swift::ApplyExpr*) + 1331
6  swift                    0x000000010392ee7c (anonymous namespace)::Verifier::walkToExprPost(swift::Expr*) + 300
7  swift                    0x0000000103941aef swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Expr*) + 1327
8  swift                    0x0000000103944117 swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Stmt*) + 359
9  swift                    0x0000000103946645 (anonymous namespace)::Traversal::visitAbstractFunctionDecl(swift::AbstractFunctionDecl*) + 725
10 swift                    0x0000000103940c96 (anonymous namespace)::Traversal::doIt(swift::Decl*) + 310
11 swift                    0x0000000103945eab (anonymous namespace)::Traversal::visitNominalTypeDecl(swift::NominalTypeDecl*) + 475
12 swift                    0x0000000103940c88 (anonymous namespace)::Traversal::doIt(swift::Decl*) + 296
13 swift                    0x0000000103940b4b swift::Decl::walk(swift::ASTWalker&) + 27
14 swift                    0x000000010392e1a5 swift::verify(swift::Decl*) + 133
15 swift                    0x000000010373a33b swift::ModuleFile::verify() const + 91
16 swift                    0x00000001037a5cb8 swift::SerializedModuleLoader::verifyAllModules() + 40
17 swift                    0x00000001038c01e9 swift::ASTContext::verifyAllLoadedModules() const + 89
18 swift                    0x00000001036eca01 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int, unsigned int, unsigned int) + 2193
19 swift                    0x0000000103325158 swift::CompilerInstance::parseAndCheckTypes(swift::CompilerInstance::ImplicitImports const&) + 744
20 swift                    0x0000000103324a38 swift::CompilerInstance::performSema() + 472
21 swift                    0x00000001027b1f40 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 1904
22 swift                    0x00000001027b07be swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3310
23 swift                    0x000000010276d0dd main + 2317
24 libdyld.dylib            0x00007fff5c3ea015 start + 1
25 libdyld.dylib            0x0000000000000043 start + 2747359279
Stack dump:
0.  Program arguments: /Library/Developer/Toolchains/swift-4.2-DEVELOPMENT-SNAPSHOT-2018-04-23-a.xctoolchain/usr/bin/swift -frontend -c /Users/ksmiley/Downloads/TestCompilerCrash/TestCompilerCrash/Bar.swift -primary-file /Users/ksmiley/Downloads/TestCompilerCrash/TestCompilerCrash/Bar+Extension.swift -emit-module-path /Users/ksmiley/Downloads/TestCompilerCrash/build.noindex/TestCompilerCrash/Build/Intermediates.noindex/TestCompilerCrash.build/Debug-iphonesimulator/TestCompilerCrash.build/Objects-normal/x86_64/Bar+Extension~partial.swiftmodule -emit-module-doc-path /Users/ksmiley/Downloads/TestCompilerCrash/build.noindex/TestCompilerCrash/Build/Intermediates.noindex/TestCompilerCrash.build/Debug-iphonesimulator/TestCompilerCrash.build/Objects-normal/x86_64/Bar+Extension~partial.swiftdoc -serialize-diagnostics-path /Users/ksmiley/Downloads/TestCompilerCrash/build.noindex/TestCompilerCrash/Build/Intermediates.noindex/TestCompilerCrash.build/Debug-iphonesimulator/TestCompilerCrash.build/Objects-normal/x86_64/Bar+Extension.dia -emit-dependencies-path /Users/ksmiley/Downloads/TestCompilerCrash/build.noindex/TestCompilerCrash/Build/Intermediates.noindex/TestCompilerCrash.build/Debug-iphonesimulator/TestCompilerCrash.build/Objects-normal/x86_64/Bar+Extension.d -emit-reference-dependencies-path /Users/ksmiley/Downloads/TestCompilerCrash/build.noindex/TestCompilerCrash/Build/Intermediates.noindex/TestCompilerCrash.build/Debug-iphonesimulator/TestCompilerCrash.build/Objects-normal/x86_64/Bar+Extension.swiftdeps -target x86_64-apple-ios11.3 -enable-objc-interop -sdk /Applications/Xcode-9.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk -I /Users/ksmiley/Downloads/TestCompilerCrash/build.noindex/TestCompilerCrash/Build/Products/Debug-iphonesimulator -F /Users/ksmiley/Downloads/TestCompilerCrash/build.noindex/TestCompilerCrash/Build/Products/Debug-iphonesimulator -enable-testing -g -module-cache-path /Users/ksmiley/Downloads/TestCompilerCrash/build.noindex/ModuleCache.noindex -swift-version 4 -enforce-exclusivity=checked -Onone -D DEBUG -serialize-debugging-options -Xcc -I/Users/ksmiley/Downloads/TestCompilerCrash/build.noindex/TestCompilerCrash/Build/Intermediates.noindex/TestCompilerCrash.build/Debug-iphonesimulator/TestCompilerCrash.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/ksmiley/Downloads/TestCompilerCrash/build.noindex/TestCompilerCrash/Build/Intermediates.noindex/TestCompilerCrash.build/Debug-iphonesimulator/TestCompilerCrash.build/TestCompilerCrash-generated-files.hmap -Xcc -I/Users/ksmiley/Downloads/TestCompilerCrash/build.noindex/TestCompilerCrash/Build/Intermediates.noindex/TestCompilerCrash.build/Debug-iphonesimulator/TestCompilerCrash.build/TestCompilerCrash-own-target-headers.hmap -Xcc -I/Users/ksmiley/Downloads/TestCompilerCrash/build.noindex/TestCompilerCrash/Build/Intermediates.noindex/TestCompilerCrash.build/Debug-iphonesimulator/TestCompilerCrash.build/TestCompilerCrash-all-target-headers.hmap -Xcc -iquote -Xcc /Users/ksmiley/Downloads/TestCompilerCrash/build.noindex/TestCompilerCrash/Build/Intermediates.noindex/TestCompilerCrash.build/Debug-iphonesimulator/TestCompilerCrash.build/TestCompilerCrash-project-headers.hmap -Xcc -I/Users/ksmiley/Downloads/TestCompilerCrash/build.noindex/TestCompilerCrash/Build/Products/Debug-iphonesimulator/include -Xcc -I/Users/ksmiley/Downloads/TestCompilerCrash/build.noindex/TestCompilerCrash/Build/Intermediates.noindex/TestCompilerCrash.build/Debug-iphonesimulator/TestCompilerCrash.build/DerivedSources/x86_64 -Xcc -I/Users/ksmiley/Downloads/TestCompilerCrash/build.noindex/TestCompilerCrash/Build/Intermediates.noindex/TestCompilerCrash.build/Debug-iphonesimulator/TestCompilerCrash.build/DerivedSources -Xcc -DDEBUG=1 -Xcc -working-directory/Users/ksmiley/Downloads/TestCompilerCrash -module-name TestCompilerCrash -o /Users/ksmiley/Downloads/TestCompilerCrash/build.noindex/TestCompilerCrash/Build/Intermediates.noindex/TestCompilerCrash.build/Debug-iphonesimulator/TestCompilerCrash.build/Objects-normal/x86_64/Bar+Extension.o -index-store-path /Users/ksmiley/Downloads/TestCompilerCrash/build.noindex/TestCompilerCrash/Index/DataStore -index-system-modules 
1.  While walking into body of 'init()' in module 'CoreLocation'
2.  While verifying ApplyExpr expression at [<invalid loc> - <invalid loc>]
@keith
Copy link
Collaborator Author

keith commented Apr 26, 2018

I am able to workaround this by adding a private property like this:

private let a = CLLocationCoordinate2D()

Along with the associated import.

@AnnaZaks
Copy link
Mannequin

AnnaZaks mannequin commented May 1, 2018

Swift Sync System create

@AnnaZaks
Copy link
Mannequin

AnnaZaks mannequin commented Aug 4, 2018

@keith,
This is marked as a duplicate of the issue that is resolved. Could you verify if the problem is fixed and if so move the JIRA to "Closed"?
Thanks!
Anna

@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

2 participants