How much stack space should Windows reserve for stack overflow exceptions?
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
We reserve some stack space for handling stack overflow exceptions. Our exception handler just prints a stack overflow message along with the thread name. Currently we reserve ~20kb of stack:
This number is somewhat arbitrary and was chosen over a decade ago, pre-1.0, when Rust was a very different language. That said, we set the main thread to have a stack size of 1mb by default so 20kb is just a few percent of it. Still, sometimes every byte counts and I think it would be useful to have some kind of rationale for the number (e.g. is, say, 4kb not enough?).
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
Start with library/std/src/sys/pal/windows/stack_overflow.rs at the current stack reservation. Investigate how Windows stack-overflow exception handling uses that reserved space and what the handler must do. Done means establishing a defensible reservation size and documenting the rationale, or identifying a justified change.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- operating-systems
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100