rr-debugger / rr-debugger/rr

valgrind aborts after fork during replay

Open
#1,276 1 comment 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

#16. My guess is that valgrind saves a tid value before ptrace-seize, then after makes a syscall that exposes a tid. Since before-seize the tid is real, and afterwards emulated from the recording, the world changes out from under valgrind and it's unhappy.

valgrind: ../../coregrind/m_scheduler/sema.c:139 (vgModuleLocal_sema_up): Assertion 'sema->owner_lwpid == VG_(gettid)()' failed.

This obviously causes a replay divergence and rr abort.

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 at the Valgrind assertion in coregrind/m_scheduler/sema.c:139 and trace the interaction around fork, ptrace-seize, and replayed thread IDs. Reproduce the failure and determine what change prevents the semaphore assertion and replay divergence.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, linux
Domain
devtools, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.