rr-debugger / rr-debugger/rr

Reproducible assertion failure in check_ticks_consistency

Open
#1,853 15 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

I am running into an internal rr assertion failure. The program I originally ran into this assertion failure on is a bit more complicated, but I have boiled it down to a smaller example:

  1 #include <stdio.h>
  2 
  3 #define SIZE 97
  4 
  5 int main () {
  6   int result;
  7   int ia[SIZE];
  8   int i = 0;
  9   int some_number = 1234;
 10 
 11   printf("begin\n");
 12 
 13   for (i = 0; i < SIZE; ++i) {
 14     ia[i] = some_number;
 15   }
 16 
 17   result = ia[SIZE-10];
 18   printf("result = %d\n", result);
 19 
 20   return 0;
 21 }

I am using gcc -g -O0 source01.c -o a.out (gcc version 4.8.4) to compile the program, and I am running rr 4.4.0. I compile the program, run rr record ./a.out, and run rr replay. Then, run the following sequence of commands:

break source01.c:18
continue
watch -l result
reverse-cont

I get the following error from the reverse-cont:

[FATAL /home/roc/rr/rr/src/ReplaySession.cc:847:check_ticks_consistency() errno: SUCCESS] 
 (task 32134 (rec:32128) at time 124)
 -> Assertion `ticks_now == trace_ticks' failed to hold. ticks mismatch for 'SYSCALL: mprotect'; expected 19400, got 19401
Launch gdb with 
  gdb '-l' '-1' '-ex' 'target extended-remote :32134' /home/bddicken/.local/share/rr/latest-trace/mmap_hardlink_3_a.out

Getting this error is reproducible as well. Interestingly, I tried several values for SIZE of 97 and above (97, 98, 99, 100) and I get this error for all of those values. I also tried several values less than 97 (96, 88, 75, 50) and I do not get this assertion error for any of those values. Perhaps this has something to do with it.

I see issues #1734 and #1771 report similar-looking errors. However, both of those issues remain open, and this error is slightly different.

Can someone else reproduce this? And does anyone know of a solution? Thanks.

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

Reproduce the failure with the source01.c example, gcc -g -O0, rr record/replay, and the listed GDB commands. Start at rr/src/ReplaySession.cc:847 in check_ticks_consistency() and inspect the mprotect tick mismatch during reverse-cont. Done means this reproducible sequence no longer reaches the 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
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.