rr is not compatible with valgrind
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 10.7k
- Forks
- 662
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 2
Description
@pnkfelix reports that attempting to record valgrind with rr triggers an internal rr assertion.
After a brief investigation, valgrind is unmapping librrpreload.so at https://sourceware.org/git/?p=valgrind.git;a=blob;f=coregrind/m_initimg/initimg-linux.c;h=4da9a8b9760b42f98e6634ea9d83954d9caf1d0b;hb=HEAD#l913. This then causes AutoRemoteSyscalls to die next time we try to inject a syscall. This would seem to be fallout from @Keno's make-librrpreload-act-like-the-VDSO work from a while back.
I'm not sure what the motivation for valgrind's behavior is. Perhaps it could check for RUNNING_UNDER_RR in the env and not do that. Regardless, adding a break to skip the code in that case does get valgrind to record and replay successfully (admittedly valgrinding a very simple program).
Contributor 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.
Research direction
Start by examining Valgrind's coregrind/m_initimg/initimg-linux.c around the unmapping of librrpreload.so, then trace the resulting failure in rr's AutoRemoteSyscalls. Reproduce recording and replay with Valgrind, including the RUNNING_UNDER_RR workaround described in the issue; done means Valgrind can record and replay under rr without the internal assertion.
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
- Mostly clear
- Newbie friendliness
- 35/100