checksum on-all-event fails when parent doesn't wait for child
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 10.7k
- Forks
- 662
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 2
Description
Reproduced with the following code reduced from checksum_sanity
#include "util.h"
int main(int argc, char **argv) {
(void)argv;
pid_t child = fork();
if (!child) {
atomic_puts("child");
return 77;
}
if (argc > 1) {
int status;
test_assert(child == wait(&status));
test_assert(WIFEXITED(status) && WEXITSTATUS(status) == 77);
}
return 0;
}
When replaying and recording using --checksum=on-all-events, this fails with a checksum mismatch in a rwx mapping area just below the rr pages:
0x68000000-0x68200000 rwxp 00000000 00:00 0 (recorded checksum:0xfeef2f0f; replaying checksum:0x6d4236f)
The recorded one has a bunch of content in that area whereas the replay one seems to be mostly zero. If you pass in any arguments to the recording to let it take the branch with the wait, the divergence will go away.
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 reproducing checksum_sanity with the reduced fork/wait program and --checksum=on-all-events, comparing recording and replay with and without an argument. Investigate why the rwx mapping below the rr pages has different checksums when the parent does not wait; done means the reported checksum mismatch no longer occurs in that case.
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
- 35/100