rust-lang / rust-lang/rust

Any prrogram force-depends on sigaction (make std's signal handler optional)

Open
#153,426 12 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs-triage T-libs
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

With fn main(){}, I see

strace -o /dev/null -e inject=/sigaction:error=EPERM ./main
fatal runtime error: assertion failed: signal(libc::SIGPIPE, handler) != libc::SIG_ERR, aborting

It does not happen for C true command.

utils/coreutils disables custom handler after initialized them to generate coredump, but it makes uutils/true 4.4x slower and the command still fails if sigaction is unavailable since std calls sigaction. It should be modified by attribute.

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

Reproduce the failure with fn main(){} and the strace sigaction error injection shown in the report. Read the standard-library signal initialization path and compare it with the uutils/coreutils workaround linked in the issue. Done should mean an explicit attribute can make the standard signal handler optional, while programs still behave correctly when sigaction is unavailable.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.