rust-lang / rust-lang/rust

regression: worker-thread stack overflow while building stage1 rustc on sparcv9-sun-solaris

Open
#155,234 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug needs-triage O-solaris S-has-bisection
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

I am seeing a regression when building Rust on sparcv9-sun-solaris.

Environment

  • host: sparcv9-sun-solaris
  • OS: Solaris 11.4 on sun4v
  • build type: normal dist/nightly build

Bisection
git bisect points to this as the first bad commit: https://github.com/rust-lang/rust/commit/3f34c31af945def1ace8c74216de2f60ae866d8c

Author: Edvin Bryntesson epost@edvinbryntesson.se
Date: Sun Feb 22 15:31:39 2026 +0100

  add variant `ExpectedNameValueAsLastArgument` to `AttributeParseErrorReason`

  compiler/rustc_attr_parsing/src/context.rs
  compiler/rustc_attr_parsing/src/session_diagnostics.rs

Failure
The build fails while compiling rustc_attr_parsing:

thread 'lto cgu.04' (26) has overflowed its stack
fatal runtime error: stack overflow, aborting
rustc exited with signal: 6 (SIGABRT) (core dumped)
error: could not compile `rustc_attr_parsing` (lib)

Notes

  • Changing ulimit -s did not help.
  • The overflow is in a Rust-created worker thread, not the shell/main thread.
  • From source inspection, rustc worker threads use the internal default stack size unless overridden via RUST_MIN_STACK.

Workaround
Setting:

RUST_MIN_STACK=16777216

makes the same build pass on this machine.

So the current picture is:

  • default worker-thread stack (8 MiB) fails on this target/build
  • 16 MiB is sufficient in my testing

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the bisected commit and inspect compiler/rustc_attr_parsing/src/context.rs and compiler/rustc_attr_parsing/src/session_diagnostics.rs. Reproduce the stage1 dist/nightly build on sparcv9-sun-solaris, comparing the default worker-thread stack with RUST_MIN_STACK=16777216. Done means the build no longer overflows the worker-thread stack without relying on that workaround.

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
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.