With SIGCHLD ignored, `Drop` takes 2 s per terminal and signals an already-reaped pid
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
Research direction
Start with spawn.rs:84-86, then read terminal.rs:4052-4068, 4350-4368, and 4390-4392, along with DESIGN.md’s Drop guarantee. The issue calls for a separate-binary test because it changes process-wide signal state; use the described ignored-SIGCHLD setup and verify that drop finishes in milliseconds without signaling. Also check that signal() refuses and wait_exit names the ECHILD cause.
Written by the indexing model from the issue text.
Description
What happens. When the test process ignores SIGCHLD, the kernel reaps children itself. spawn.rs:84-86 already routes this setup to the PTY layer on purpose. But teardown treats the missing child as still alive:
signal(SIGCHLD, SIG_IGN); spawn `sh -c "echo done"`; wait for "done"; drop
wait_exit: Err("i/o error: No child processes (os error 10)")
drop (child exited, wait_exit not ok) took 2.000238871s
drop of exited child, no wait_exit, took 2.000225776s
A reviewer's strace showed kill(pid, SIGHUP) = -1 ESRCH and kill(pid, SIGKILL) = -1 ESRCH, for every terminal.
Cause. try_wait returns Err(ECHILD), and Drop and stop_child (terminal.rs:4350-4368, 4421-4422) read that as "not reaped". They send SIGHUP, poll for HANGUP_GRACE, send SIGKILL, then poll until DROP_REAP_GRACE. signal() (4052-4068) would likewise kill the pid, because exit_status is still None.
The claim. send_signal's SAFETY comment (4390-4392) says the pid "is never an unrelated, recycled pid". DESIGN.md says Drop kills "unless already reaped". Once the kernel has reaped the child, its pid can be recycled, so both claims fail here.
Fix direction.
- Treat
try_wait() == Err(ECHILD)as "reaped, status unknown", and skipstop_child. - Record the state so
signal()refuses withError::Input. - Have
wait_exit's error name the cause ("SIGCHLD is ignored; the kernel reaped the child").
Done when a drop in this setup takes milliseconds and sends no signal, with a test in its own binary (it changes process-wide signal state).
- Dominant language
- Rust
- Stars
- 28
- Forks
- 24
- Avg merge
- 11h 23m
- Merged PRs (30d)
- 42
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing 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.
More from vyncint/termlens
-
documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
documentation good first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
Maintainers usually reply within 1 day
-
Release notes show a broken link: `extract-changelog.sh` copies a reference but not its definitionOpenbug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
All issues in vyncint/termlens
Similar issues
-
good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
servo/rust-smallvec#827 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
nowledge-co/hawdb#1400 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
calcit-lang/caps#16 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
penso/herdr-gpui#934 ·
Maintainers usually reply within 1 day
-
🎉 Add BossanovaOpen
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
jaywcjlove/awesome-mac#4096 ·
Maintainers usually reply within 1 day