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-10310] swiftc -sanitize=thread seg fault #52710

Closed
swift-ci opened this issue Apr 4, 2019 · 5 comments
Closed

[SR-10310] swiftc -sanitize=thread seg fault #52710

swift-ci opened this issue Apr 4, 2019 · 5 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

Comments

@swift-ci
Copy link
Collaborator

swift-ci commented Apr 4, 2019

Previous ID SR-10310
Radar None
Original Reporter rayfix (JIRA User)
Type Bug
Status Closed
Resolution Cannot Reproduce

Attachment: Download

Environment

endurance:~ rayfix$ swiftc --version

Apple Swift version 5.0 (swiftlang-1001.0.69.5 clang-1001.0.46.3)

Target: x86_64-apple-darwin18.5.0

endurance:~ rayfix$

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

md5: 005ede5ceb1e5fc2f4e7e3470e1143ca

Issue Description:

When I run the swift 5 compiler with the attached file and thread sanitization, it segfaults. (It is fine when -sanitize=thread is omitted.)

swiftc -sanitize=thread WeakArray.swift

Stack dump:

0. Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -primary-file WeakArray.swift -target x86_64-apple-darwin18.5.0 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -sanitize=thread -color-diagnostics -module-name WeakArray -o /var/folders/n8/cgcw0ndx28v3y_zczm2fzdcw0000gn/T/WeakArray-59f316.o

1. Running pass 'CallGraph Pass Manager' on module '/var/folders/n8/cgcw0ndx28v3y_zczm2fzdcw0000gn/T/WeakArray-59f316.o'.

2. Running pass 'Dominator Tree Construction' on function '@"$s9WeakArrayAAVyxSgSicir.resume.0"'

0 swift 0x000000010f8a6ee3 PrintStackTraceSignalHandler(void*) + 51

1 swift 0x000000010f8a66bc SignalHandler(int) + 348

2 libsystem_platform.dylib 0x00007fff70b53b5d _sigtramp + 29

3 libsystem_platform.dylib 0x0000000110e39a00 _sigtramp + 2687393472

4 swift 0x000000010f77f991 llvm::DomTreeBuilder::SemiNCAInfo<llvm::DominatorTreeBase<llvm::BasicBlock, false> >::CalculateFromScratch(llvm::DominatorTreeBase<llvm::BasicBlock, false>&, llvm::DomTreeBuilder::SemiNCAInfo<llvm::DominatorTreeBase<llvm::BasicBlock, false> >::BatchUpdateInfo*) + 1025

5 swift 0x000000010f77f583 llvm::DominatorTreeWrapperPass::runOnFunction(llvm::Function&) + 19

6 swift 0x000000010f7c25ad llvm::FPPassManager::runOnFunction(llvm::Function&) + 1613

7 swift 0x000000010e39ee27 (anonymous namespace)::CGPassManager::runOnModule(llvm::Module&) + 2311

8 swift 0x000000010f7cea00 llvm::legacy::PassManager::run(llvm::Module&) + 1696

9 swift 0x000000010b8e4518 swift::performLLVM(swift::IRGenOptions&, swift::DiagnosticEngine*, llvm::sys::SmartMutex<false>, llvm::GlobalVariable, llvm::Module*, llvm::TargetMachine*, swift::version::Version const&, llvm::StringRef, swift::UnifiedStatsReporter*) + 5816

10 swift 0x000000010b70b91e performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 51566

11 swift 0x000000010b6fb6de swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 6862

12 swift 0x000000010b6997be main + 1246

13 libdyld.dylib 0x00007fff7096e3d5 start + 1

14 libdyld.dylib 0x0000000000000010 start + 2406030396

<unknown>:0: error: unable to execute command: Segmentation fault: 11

<unknown>:0: error: compile command failed due to signal 11 (use -v to see invocation)

@belkadan
Copy link
Contributor

belkadan commented Apr 8, 2019

cc @yln, @kubamracek

@yln
Copy link
Contributor

yln commented May 21, 2019

Compiles without error for me, try updating your Swift version:

➤ swiftc --version
Apple Swift version 5.0.1 (swiftlang-1001.0.82.4 clang-1001.0.46.5)
Target: x86_64-apple-darwin19.0.0

➤ swiftc -sanitize=thread WeakArray.swift // compiles without error

➤ swiftc --version
Apple Swift version 5.1 (swiftlang-1100.0.38 clang-1100.0.20.14)
Target: x86_64-apple-darwin19.0.0

➤ swiftc -sanitize=thread WeakArray.swift // compiles without error

@yln
Copy link
Contributor

yln commented May 21, 2019

Closing this as "Cannot Reproduce". Feel free to comment/reopen if updating does not resolve this.

@swift-ci
Copy link
Collaborator Author

Comment by Ray Fix (JIRA)

You are correct. It no longer crashes. The problem occurred in the first Xcode release of Swift 5.

@swift-ci
Copy link
Collaborator Author

Comment by Ray Fix (JIRA)

If it pops up again it might be good to add a test.

@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

4 participants