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-12306] 5.2 compiler segfault using Foundation in a script #54736

swift-ci opened this issue Mar 2, 2020 · 2 comments

[SR-12306] 5.2 compiler segfault using Foundation in a script #54736

swift-ci opened this issue Mar 2, 2020 · 2 comments


Copy link

@swift-ci swift-ci commented Mar 2, 2020

Previous ID SR-12306
Radar rdar://problem/59976668
Original Reporter samrayner (JIRA User)
Type Bug
Status Resolved
Resolution Done

Attachment: Download

  • Apple Swift version 5.2 (swiftlang-1103.0.22 clang-1103.0.22)

  • macOS Catalina 10.15.3

  • Xcode 11.4 (beta 2)

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

md5: 59aad6b7028ea15dce1d39d0fb448d94

Issue Description:

Reproduced on two Macs with Xcode 11.4 beta 2 or the 5.2 snapshot toolchain.

The compiler will segmentation fault running the following:

> echo "import Foundation; print(Date())" | swift -

The same crash occurs when running a file:


import Foundation
> swift test.swift

This crash does not occur with Swift 5.1 (Xcode 11.3.1) or when running the 5.2 REPL:

  1> import Foundation
  2> print(Date())
2020-03-02 09:59:29 +0000

Joe Groff has been unable to reproduce:

Filed in Feedback Assistant as FB7598190.


Stack dump:
0.  Program arguments: /Users/samrayner/Applications/ -frontend -interpret - -enable-objc-interop -stack-check -sdk /Users/samrayner/Applications/ -color-diagnostics -module-name main 
1.  Apple Swift version 5.2 (swiftlang-1103.0.22 clang-1103.0.22)
2.  While running user code "<stdin>"
0  swift                    0x00000001079729b3 PrintStackTraceSignalHandler(void*) + 51
1  swift                    0x0000000107972170 SignalHandler(int) + 352
2  libsystem_platform.dylib 0x00007fff6f5d942d _sigtramp + 29
3  libsystem_platform.dylib 0x0000000000000030 _sigtramp + 2426563616
4  swift                    0x000000010327583c llvm::MCJIT::runFunction(llvm::Function*, llvm::ArrayRef<llvm::GenericValue>) + 460
5  swift                    0x000000010327cc2a llvm::ExecutionEngine::runFunctionAsMain(llvm::Function*, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, char const* const*) + 1946
6  swift                    0x00000001032502c2 performCompileStepsPostSILGen(swift::CompilerInstance&, swift::CompilerInvocation&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule> >, bool, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::PrimarySpecificPaths const&, bool, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 14338
7  swift                    0x00000001032447f5 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 62917
8  swift                    0x00000001031b5283 main + 1299
9  libdyld.dylib            0x00007fff6f3e07fd start + 1
[1]    82451 done                echo "import Foundation;print(Date())" | 
       82452 segmentation fault  swift -
Copy link

@hborla hborla commented Mar 3, 2020

@swift-ci create

Copy link
Collaborator Author

@swift-ci swift-ci commented Mar 27, 2020

Comment by Sam Rayner (JIRA)

This is resolved as it was discovered by Apple to be caused by SwiftGen.

SwiftGen issue filed: SwiftGen/SwiftGen#686

Thank you to the rep(s) who assisted me on Feedback Assistant!

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

2 participants