rr-debugger / rr-debugger/rr

Desched signal restart can cause behavior difference in tracee

Open
#3,010 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
10.7k
Forks
662
Avg merge
2d 3h
Merged PRs (30d)
2

Description

On recent rr/wine, I'm seeing most wine recordings exit with a "partial write" error. It turns out wine is using a writev syscall without proper restart logic here: https://github.com/wine-mirror/wine/blob/8125687441923e11ffb8918b89f3c0d85040b8e2/dlls/ntdll/unix/server.c#L183-L213. Now, this is essentially a wine bug (for which I will submit a patch to wine upstream), but wine doesn't use signals very much, so in the absence of rr it mostly works fine. With rr however, we get a syscall interrupt every time, because this syscall is blocking, so rr's desched signal fires and causes a syscall restart and tracee behavior difference. I'm thinking we should maybe consider automatically restarting syscalls for the tracee if we know that the interrupt was due to a desched signal in order to try to match the untraced behavior as closely as possible.

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 by reading the desched-signal and syscall-restart behavior described in the issue, along with Wine's dlls/ntdll/unix/server.c lines 183-213. Determine whether rr can distinguish desched interruptions from other syscall interrupts and define tests showing that traced Wine behavior matches untraced behavior without breaking restart semantics.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, linux
Domain
devtools, operating-systems
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.