Segfault on amd64 under QEMU
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
I tried this code:
docker run -it --rm --platform=linux/amd64 ubuntu:25.04 bash -c '
apt update && apt install -y curl;
curl --proto \'=https\' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y;
. "$HOME/.cargo/env";
rustc --help'
I expected to see this happen: no segfault
Instead, this happened: segfault
note: we would appreciate a report at https://github.com/rust-lang/rust
help: you can increase rustc's stack size by setting RUST_MIN_STACK=16777216
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
note: i'm on arm64 host.
reminds me of this issue which i've reported a while ago, which turned out to be an issue in upstream golang.
this is an escalation of this issue.
Meta
rustc --version --verbose: 1.90-x86_64-unknown-linux-gnu
Backtrace
/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-890dfd19c9b338c0.so(+0x3c83a9f) [0xffffade83a9f]
/lib/x86_64-linux-gnu/libc.so.6(+0x458d0) [0xffffaa0268d0]
/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/rustc(realloc+0xc5c) [0x55555557be2c]
/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-890dfd19c9b338c0.so(+0x5403598) [0xffffaf603598]
/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-890dfd19c9b338c0.so(_ZN5alloc3ffi5c_str7CString19_from_vec_unchecked17hd3132e195204e147E+0x4d) [0xffffb06ea54d]
/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-890dfd19c9b338c0.so(_ZN118_$LT$std..thread..thread_name_string..ThreadNameString$u20$as$u20$core..convert..From$LT$alloc..string..String$GT$$GT$4from17h40ccdde012c08396E+0x49) [0xffffb06ea65d]
/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-890dfd19c9b338c0.so(_RNvCsaeDQxODg9Sp_17rustc_driver_impl21install_ctrlc_handler+0x1da) [0xffffb070efda]
/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-890dfd19c9b338c0.so(_RNvCsaeDQxODg9Sp_17rustc_driver_impl4main+0x15e) [0xffffb071049e]
/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/rustc(+0x37a37) [0x55555558da37]
/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/rustc(+0x37a23) [0x55555558da23]
/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/rustc(+0x37a19) [0x55555558da19]
/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-890dfd19c9b338c0.so(_ZN3std2rt19lang_start_internal17h34f9328d113fd60aE+0x491) [0xffffb077c451]
/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/rustc(+0x74da7) [0x5555555cada7]
/lib/x86_64-linux-gnu/libc.so.6(+0x2a578) [0xffffaa00b578]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x8b) [0xffffaa00b63b]
/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/rustc(+0x74cb4) [0x5555555cacb4]
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Run the provided Docker command on an arm64 host and compare the rustc version, QEMU output, and backtrace. The stack points through rustc's realloc, thread-name conversion, and ctrl-c handler; done means identifying whether the fault is in rustc or QEMU and preventing the reproducible segmentation fault.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100