rustc SIGSEGV on RISC-V when compiling serde and other crates (stack overflow on 4 GB stack)
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
I tried compiling this Rust project on native riscv hardware. The project uses deps like serde, arrayvec, and others that involve macros and traits.
I expected to see this happen:
build using cargo build --release
Instead this happened:
rustc crashes with a segmentation fault (SIGSEGV) inside libc.so.6. This occurs on both stable and nightly Rust, even after setting high stack limits (RUST_MIN_STACK=4294967296, i.e. 4 GB) and with 8 GiB of swap active.
rustc --version --verbose:
rayan@k1:~$ rustc --version --verbose
rustc 1.88.0 (6b00bc388 2025-06-23)
binary: rustc
commit-hash: 6b00bc3880198600130e1cf62b8f8a93494488cc
commit-date: 2025-06-23
host: riscv64gc-unknown-linux-gnu
release: 1.88.0
LLVM version: 20.1.5
Repository:
https://github.com/planetryan/qoa
To reproduce, clone the repository and run on riscv cpu
export RUST_MIN_STACK=4294967296
ulimit -s unlimited
cargo build --release
Even compiling deps like serde crashs the compiler with a SIGSEGV on native RISC-V hardware.
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
Clone the linked qoa repository on native riscv64gc-unknown-linux-gnu hardware and run cargo build --release with the reported stack settings. Start by confirming the SIGSEGV in rustc 1.88.0 and then isolate whether serde, arrayvec, macros, or traits trigger it; done means a reduced reproducer and a confirmed compiler fix or actionable diagnosis.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100