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-8809] Enabling TSan causes immediate segfault on Swift 4.2 for Linux #51317
Comments
We seem to be using the system llvm's copy of the sanitizer code here, as the line numbers don't line up with swift-compiler-rt's lines, but they do line up with LLVM's compiler-rt line numbers for version 6.0, which is what Ubuntu 18.04 ships. The crash on line 754 becomes a crash on the call to |
cc george.karpenkov (JIRA User) |
@swift-ci create |
Comment by George Karpenkov (JIRA) @kubamracek for comments. Sanitizers on Swift on Linux are not fully supported, and there are many known issues. That said, it still should not segfault on launch. |
Linking against anything from the "system LLVM" sounds like a red flag, since LLVM isn't generally ABI-stable and Swift is fairly tightly coupled to the LLVM libraries it builds alongside itself. Could this just be a build system configuration bug that we're failing to find and link to the swift compiler-rt libraries? |
Removing the system LLVM entirely leads to the following error message: root@7b6ced73e86a:/# swiftc -v test.swift
Swift version 4.2 (swift-4.2-RELEASE)
Target: x86_64-unknown-linux-gnu
/swift-4.2-RELEASE-ubuntu18.04/usr/bin/swift -frontend -c -primary-file test.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -color-diagnostics -module-name test -o /tmp/test-24c634.o
/swift-4.2-RELEASE-ubuntu18.04/usr/bin/swift-autolink-extract /tmp/test-24c634.o -o /tmp/test-a24bd9.autolink
<unknown>:0: error: unable to execute command: <unknown> |
This also happens even if I install all of Swift directly over my system libraries (e.g. |
Comment by George Karpenkov (JIRA) > removing the system llvm breaks the Swift compiler. That's the real issue then: the downloaded toolchain definitely should be self-sufficient. "unable to execute command: <unknown>" is not very informative, there's no stack trace at all? |
There is really no stack trace at all. That’s the complete output from {{ swiftc -v }}. |
Environment
Ubuntu 18.04, Swift version 4.2 (swift-4.2-RELEASE)
Additional Detail from JIRA
md5: 87fcf099d809e6599a73947c53fb79a9
Issue Description:
Compiling any Swift program on Swift 4.2 on Linux with
-sanitize=thread
causes an immediate segmentation fault when the program starts.The backtrace is:
User code has not even begun to run when this crash occurs.
The text was updated successfully, but these errors were encountered: