Skip to content

Don't retry a deferred syscall patch at the syscall instruction - #4178

Open
Keno wants to merge 1 commit into
rr-debugger:masterfrom
ChronitonAI:deferred-patch-changed-syscall
Open

Keno wants to merge 1 commit into
rr-debugger:masterfrom
ChronitonAI:deferred-patch-changed-syscall

Conversation

@Keno

@Keno Keno commented Nov 28, 2026

Copy link
Copy Markdown
Member

[Encountered/debugged/patch/test by AI - that said, I think this is another symptom of rr's "stack" modeling of syscalls that doesn't really match how linux works as previously noted, so I'll look at that again]

When a signal handler changed the number of an interrupted syscall that would restart, rr retried the deferred patch of the syscall's site at the rt_sigreturn exit, with the task at the site's syscall instruction, which the patch overwrites. The task then ran the patch's padding instead of the new syscall and got the syscall number as its result. Leave the patch to that syscall's exit.

Test: x86/deferred_patch_changed_restart.

When a signal handler changed the number of an interrupted syscall that
would restart, rr retried the deferred patch of the syscall's site at
the rt_sigreturn exit, with the task at the site's syscall instruction,
which the patch overwrites. The task then ran the patch's padding
instead of the new syscall and got the syscall number as its result.
Leave the patch to that syscall's exit.

Test: x86/deferred_patch_changed_restart.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant