-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
FreeBSD segfault when capturing backtrace with RUST_BACKTRACE=1 #132185
Comments
Thanks for the report. rust-lang/cargo#14712 might be related. Do you happen to know the RAM size of the CI machine? |
I don't. But I can also reproduce the problem locally with 64 GB of RAM. |
Cargo on nightly hasn't changed since nightly-2024-10-20. It is on the commit cf53cc54bb593b5ec3dc2be4b1702f50c36d24d5. The last submodule update is #131910. I can't tell which PR is relevant to this backtrace 😞.
|
If you are able to reproduce locally, would you mind building rust-lang/cargo@8c30ce5 cargo and running with rustc from 2024-10-24? Setting |
I've managed to bisect the problem. It was introduced by 6d88158 . I don't know why yet. |
This comment has been minimized.
This comment has been minimized.
@linyihai I think you actually ran into the other bug: rust-lang/cargo#14712 , judging by the "memory allocation ... bytes failed" message. |
@ehuss what do you mean by "backtraced" as a verb? |
Sorry, that was a mis-type. I meant "bisected" (via cargo-bisect-rustc). |
@asomers could it be some ABI incompatibility with backtrace for example ? |
So I can reproduce the segfault ; however I can also reproduce the segfault with the stable 1.82 version from rustup. |
@devnexen Just to confirm, what were your reproduction steps? I have a virtual machine with FreeBSD 14.1 (amd64). The reproduction for me is:
With |
nvm I ran the wrong rustc binary, yes it works with stable.. |
I can no longer reproduce this issue when using a locally built toolchain on FreeBSD 15. I could before, but can't now, which suggests that I was probably doing something wrong before. I did find a related issue in LLVM: llvm/llvm-project#76957 . That issue can cause crashes of the sort we're seeing. Crucially, it affect the version of LLVM included in FreeBSD 13.2 and 13.3, but not 13.4. Note that the fact that Rust bundles its own version of LLVM is irrelevant, because in this stack trace we're accessing LLVM via libunwind, not directly from Rust. So perhaps #120869 caused the official build to link to a buggy version of LLVM. If so, the solution would be to update the build image to FreeBSD 13.4. HOWEVER, that could potentially break the rustup-distributed toolchain for users of FreeBSD 13.3, which is officially supported until 31-Dec of this year. So it would be better to revert PR #120869 for now, but reapply it (using FreeBSD 13.4 as the image instead of 13.2) in early 2025. But that's just my theory. To test it, we would need to build a set of x86_64 FreeBSD artifacts through Rust's CI pipeline. Is there a way to do that without merging a PR? |
Open a PR that updates to 13.4, in the PR description, include a line that says |
I thought that the string to use was |
…workingjubilee Revert "ci update freebsd version proposal, freebsd 12 being eol." This reverts commit 1239c81. Fix rust-langGH-132185 revert for now until early next year/FreeBSD 13.3 becomes EOL.
Yep, edited my comment. |
Rollup merge of rust-lang#132228 - devnexen:ci_update_fbsd_revert, r=workingjubilee Revert "ci update freebsd version proposal, freebsd 12 being eol." This reverts commit 1239c81. Fix rust-langGH-132185 revert for now until early next year/FreeBSD 13.3 becomes EOL.
Can we please reopen this issue? PR #132228 wasn't a permanent solution. |
13.2 is EoL, and 13.3 will be EoL too in about 2 months. Plus, both suffer from a bug in LLVM's libunwind. It causes a segfault inside of std::backtrace::Backtrace::capture(). Fixes rust-lang#132185
13.2 is EoL, and 13.3 will be EoL too in about 2 months. Plus, both suffer from a bug in LLVM's libunwind. It causes a segfault inside of std::backtrace::Backtrace::capture(). Fixes rust-lang#132185
CI: build FreeBSD artifacts on FreeBSD 13.4 13.2 is EoL, and 13.3 will be EoL too in about 2 months. Plus, both suffer from a bug in LLVM's libunwind. It causes a segfault inside of std::backtrace::Backtrace::capture(). Fixes rust-lang#132185 cc `@ehuss` . before you can do the trybuild, you'll also have to download new FreeBSD 13.4 base.txz images and place them in https://ci-mirrors.rust-lang.org/rustc , then update this PR with the correct file names. try-job: dist-x86_64-freebsd
13.2 is EoL, and 13.3 will be EoL too in about 2 months. Plus, both suffer from a bug in LLVM's libunwind. It causes a segfault inside of std::backtrace::Backtrace::capture(). Fixes rust-lang#132185
CI: build FreeBSD artifacts on FreeBSD 13.4 13.2 is EoL, and 13.3 will be EoL too in about 2 months. Plus, both suffer from a bug in LLVM's libunwind. It causes a segfault inside of std::backtrace::Backtrace::capture(). Fixes rust-lang#132185 cc `@ehuss` . before you can do the trybuild, you'll also have to download new FreeBSD 13.4 base.txz images and place them in https://ci-mirrors.rust-lang.org/rustc , then update this PR with the correct file names. try-job: dist-x86_64-freebsd
Problem
With recent nightly toolchains, cargo segfaults on FreeBSD x86_64. The 2024-10-17 toolchain worked fine, but the bug was present in the 2024-10-24 toolchain . The segfault is dependent on the
RUST_BACKTRACE=1
environment variable being set. This bug is causing rust-lang/libc's CI to fail.An example CI failure:
https://github.com/rust-lang/libc/runs/32002285710
The stack trace of the segfault:
Steps
In a FreeBSD x86_64 environment with the latest nightly toolchain installed:
Possible Solution(s)
No response
Notes
No response
Version
The text was updated successfully, but these errors were encountered: