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

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

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

swift-ci opened this issue Mar 2, 2020 · 2 comments
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 SILGen Area → compiler: The SIL generation stage

Comments

@swift-ci
Copy link
Collaborator

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

Environment
  • 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:

test.swift:

import Foundation
print(Date())
> 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:

https://twitter.com/jckarter/status/1230212464794488832

Filed in Feedback Assistant as FB7598190.

Stacktrace

Stack dump:
0.  Program arguments: /Users/samrayner/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -interpret - -enable-objc-interop -stack-check -sdk /Users/samrayner/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -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 -
@hborla
Copy link
Member

hborla commented Mar 3, 2020

@swift-ci create

@swift-ci
Copy link
Collaborator Author

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
@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 SILGen Area → compiler: The SIL generation stage
Projects
None yet
Development

No branches or pull requests

3 participants