rust-lang / rust-lang/rust

Poorly-documented safety assumptions in `unix::stack_overflow::init`

Open
#127,841 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-runtime A-stack-probe A-thread T-libs
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Relevant history:

It's not clear, to me, why the update of the NEEDS_ALTSTACK variable is occurring. I don't know everything there is to know about signal handlers, but I do know

  • they are terribly underspecified
  • they are surprisingly thread-specific in multithreaded programs
  • yet some aspects of them remain process-wide in relevance

We have two fairly distinct codepaths for make_handler. In code we control, we only call one or the other (i.e. a constant input). They're really quite different functions. So it's not clear where the logical dependencies emerge between the two.

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 unix::stack_overflow::init and the two make_handler code paths, then read the linked issue #69524 and pull request #69685 for context. Trace why NEEDS_ALTSTACK is updated and document the signal-handler assumptions and logical dependencies between the paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
operating-systems
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.