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-12651] Segmentation Fault when using Data in script #55095

Open
swift-ci opened this issue Apr 22, 2020 · 1 comment
Open

[SR-12651] Segmentation Fault when using Data in script #55095

swift-ci opened this issue Apr 22, 2020 · 1 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

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-12651
Radar rdar://problem/62481586
Original Reporter MaxChuquimia (JIRA User)
Type Bug
Environment

macOS 10.15.2 (19C57)

MacBook Pro (15-inch, 2019)

Xcode 11.4 (11E146)

Swift 5.2

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

md5: 765f6c0923fec2b02787945b60247f94

Issue Description:

Since installing Xcode 11.4 on my computer, some of my scripts have started failing with:

Stack dump:
0.  Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -interpret - -enable-objc-interop -stack-check -sdk /Applications/Xcode.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.32.1 clang-1103.0.32.29)
2.  While running user code "<stdin>"
0  swift                    0x000000010668d4ea PrintStackTraceSignalHandler(void*) + 42
1  swift                    0x000000010668ccc0 SignalHandler(int) + 352
2  libsystem_platform.dylib 0x00007fff6c71242d _sigtramp + 29
3  libsystem_platform.dylib 0x00007ffeed8c3fe8 _sigtramp + 2166037464
4  swift                    0x00000001024109ba llvm::MCJIT::runFunction(llvm::Function*, llvm::ArrayRef<llvm::GenericValue>) + 458
5  swift                    0x0000000102417a2b 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*) + 2011
6  swift                    0x00000001023ecaea 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*) + 14362
7  swift                    0x00000001023e14a5 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 55813
8  swift                    0x00000001023574d3 main + 1283
9  libdyld.dylib            0x00007fff6c5197fd start + 1
Segmentation fault: 11

I've narrowed down the issue - it seems to occur whenever I use Data in a script. The easiest way to reproduce this is by running the following in Terminal:

echo "import Foundation; print(Data())" | swift -

Changing Data to String (for example) does not induce the crash. I saw another open issue that seemed to be similar but it was to do with FileManager - however that too is fine for me.

I can work around this issue with export DEVELOPER_DIR=/Applications/Xcode11.3.1.app/Contents/Developer before running my scripts. Xcode projects themselves are unaffected.

@beccadax
Copy link
Contributor

@swift-ci create

@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 in itself crash Bug: A crash, i.e., an abnormal termination of software
Projects
None yet
Development

No branches or pull requests

3 participants