Skip to content

Detach a ptracer's emulated tracees when the ptracer exits - #4160

Merged
rocallahan merged 1 commit into
rr-debugger:masterfrom
ChronitonAI:emulated-tracer-leader-exit
Nov 18, 2026
Merged

rocallahan merged 1 commit into
rr-debugger:masterfrom
ChronitonAI:emulated-tracer-leader-exit

Conversation

@Keno

@Keno Keno commented Nov 17, 2026

Copy link
Copy Markdown
Member

[Encountered/debugged/patch/test by AI]

Linux detaches a ptracer's tracees when the ptracer thread exits. rr did that only in ~RecordTask, which for a thread-group leader whose process lives on comes much later, and without resuming a tracee it held at a clone, fork, vfork or exec event stop. Recording then hung, or failed with "Unhandled ptrace event" or "Exiting an execve we didn't know about". Detach the tracees when we handle the ptracer's exit, and resume a tracee we hold at an event stop with the code that resumes it for PTRACE_CONT.

Test: ptracer_death_event_stop.

Linux detaches a ptracer's tracees when the ptracer thread exits. rr
did that only in ~RecordTask, which for a thread-group leader whose
process lives on comes much later, and without resuming a tracee it
held at a clone, fork, vfork or exec event stop. Recording then hung,
or failed with "Unhandled ptrace event" or "Exiting an execve we
didn't know about". Detach the tracees when we handle the ptracer's
exit, and resume a tracee we hold at an event stop with the code that
resumes it for PTRACE_CONT.

Test: ptracer_death_event_stop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rocallahan
rocallahan merged commit 9f012b5 into rr-debugger:master Nov 18, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants