rust-lang / rust-lang/rust

Setting a lower `RUST_MIN_STACK` than `DEFAULT_STACK_SIZE` increases stack???

Open
#126,897 12 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug I-ICE T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

While working on this issue #122357, I found that setting the RUST_MIN_STACK variable size to 7mb or more, the build is successful. But the default stack size in rust is 8mb. Why do we have to set RUST_MIN_STACK again for this to work?

Steps to create the example directory are in this link https://github.com/rust-lang/rust/issues/122357#issue-2180549643
To verify this please follow these steps.

  1. setup the example from above link.
  2. Run cargo build in the example, this time the build would fail.
  3. Export RUST_MIN_STACK=$((7*1024*1024) and run cargo build again. This time the build is successful.

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 by following the example setup in issue #122357, then reproduce the failure with cargo build and compare it with the build after setting RUST_MIN_STACK to 7 MiB. Trace why the lower setting changes the result and document the cause or identify the required fix, with the original example building successfully as the completion criterion.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.