rr-debugger / rr-debugger/rr

[FATAL src/ReplayTask.cc:130:validate_regs()]

Open
#3,947 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

I am hitting this issue when trying to replay (rr replay -a) recordings I've made. The recordings are made by using a Firefox Nightly (139) debug build and visiting tiendaflores.cl waiting ~15 seconds and then closing the browser. No rr issues are observed when recording. When replaying (with -a) is when I have issues. I am using the latest rr commit 18258fa.

[FATAL src/ReplayTask.cc:130:validate_regs()]
 (task 33031 (rec:32166) at time 72658)
 -> Assertion `!comparison.mismatch_count' failed to hold. Mismatched registers, replay vs rec: r15 0x7a21836911c0 != 0x7a219409f680
Tail of trace dump:
{
  real_time:17289.017773 global_time:72638, event:`SYSCALL: sched_yield' (state:EXITING_SYSCALL) tid:32345, ticks:7235663
rax:0x0 rbx:0x7 rcx:0xffffffffffffffff rdx:0x100 rsi:0x80 rdi:0x7a219b163000 rbp:0x7a21901fd9c0 rsp:0x7a21901fd628 r8:0x7a21901f7fd0 r9:0x0 r10:0x1 r11:0x246 r12:0x7a21901fd720 r13:0x7a21901fd910 r14:0x7a219b163000 r15:0x7a21901fd630 rip:0x7a21c41984fb eflags:0x246 cs:0x33 ss:0x2b ds:0x0 es:0x0 fs:0x0 gs:0x0 orig_rax:0x18 fs_base:0x7a2190200640 gs_base:0x0
}
{
  real_time:17289.017813 global_time:72639, event:`SYSCALL: sched_yield' (state:ENTERING_SYSCALL) tid:32345, ticks:7235671
rax:0xffffffffffffffda rbx:0x8 rcx:0xffffffffffffffff rdx:0x100 rsi:0x80 rdi:0x7a219b163000 rbp:0x7a21901fd9c0 rsp:0x7a21901fd628 r8:0x7a21901f7fd0 r9:0x0 r10:0x1 r11:0x246 r12:0x7a21901fd720 r13:0x7a21901fd910 r14:0x7a219b163000 r15:0x7a21901fd630 rip:0x7a21c41984fb eflags:0x246 cs:0x33 ss:0x2b ds:0x0 es:0x0 fs:0x0 gs:0x0 orig_rax:0x18 fs_base:0x7a2190200640 gs_base:0x0
}
{
  real_time:17289.018012 global_time:72640, event:`SYSCALLBUF_FLUSH' tid:32343, ticks:1599060
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'gettid', ret:0x7e57, size:0x10 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
}
{
  real_time:17289.018018 global_time:72641, event:`SYSCALL: sched_yield' (state:ENTERING_SYSCALL) tid:32343, ticks:1599060
rax:0xffffffffffffffda rbx:0x7 rcx:0xffffffffffffffff rdx:0x2 rsi:0x0 rdi:0x0 rbp:0x7a21959ff130 rsp:0x7a21959fd438 r8:0x0 r9:0x1 r10:0x1 r11:0x246 r12:0x7a21959fd510 r13:0x7a21959ff140 r14:0x8 r15:0x7a217f34cd00 rip:0x7a21c41984fb eflags:0x246 cs:0x33 ss:0x2b ds:0x0 es:0x0 fs:0x0 gs:0x0 orig_rax:0x18 fs_base:0x7a2195a00640 gs_base:0x0
}
{
  real_time:17289.018021 global_time:72642, event:`SYSCALLBUF_RESET' tid:32343, ticks:1599060
}
{
  real_time:17289.018069 global_time:72643, event:`SYSCALL: futex' (state:EXITING_SYSCALL) tid:32197, ticks:65436
rax:0x0 rbx:0x7a21a01fffa0 rcx:0xffffffffffffffff rdx:0x0 rsi:0x189 rdi:0x7a21b0389fa8 rbp:0x7a21b0389f80 rsp:0x7a21a01ffdf0 r8:0x0 r9:0xffffffff r10:0x0 r11:0x246 r12:0x0 r13:0x0 r14:0x14 r15:0x7a21b0389fa8 rip:0x70000002 eflags:0x246 cs:0x33 ss:0x2b ds:0x0 es:0x0 fs:0x0 gs:0x0 orig_rax:0xca fs_base:0x7a21ad261640 gs_base:0x0
}
{
  real_time:17289.018184 global_time:72644, event:`SYSCALLBUF_FLUSH' tid:32197, ticks:90923
  { syscall:'futex', ret:0x0, size:0x14 }
  { syscall:'access', ret:0xfffffffffffffffe, size:0x10 }
  { syscall:'access', ret:0xfffffffffffffffe, size:0x10 }
  { syscall:'access', ret:0xfffffffffffffffe, size:0x10 }
  { syscall:'access', ret:0xfffffffffffffffe, size:0x10 }
  { syscall:'gettimeofday', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'gettimeofday', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'gettimeofday', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'gettimeofday', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
}
{
  real_time:17289.018189 global_time:72645, event:`SYSCALL: futex' (state:ENTERING_SYSCALL) tid:32197, ticks:90923
rax:0xffffffffffffffda rbx:0x7a21a01fffa0 rcx:0xffffffffffffffff rdx:0x0 rsi:0x189 rdi:0x7a21b0389fac rbp:0x7a21b0389f80 rsp:0x7a21a01ffdf0 r8:0x0 r9:0xffffffff r10:0x0 r11:0x246 r12:0x0 r13:0x0 r14:0x17 r15:0x7a21b0389fac rip:0x70000002 eflags:0x246 cs:0x33 ss:0x2b ds:0x0 es:0x0 fs:0x0 gs:0x0 orig_rax:0xca fs_base:0x7a21ad261640 gs_base:0x0
}
{
  real_time:17289.018193 global_time:72646, event:`SYSCALLBUF_RESET' tid:32197, ticks:90923
}
{
  real_time:17289.018279 global_time:72647, event:`EXIT' tid:32346, ticks:758
  { tid:32346, addr:0x7f8677e00910, length:0x4 }
}
{
  real_time:17289.018364 global_time:72648, event:`EXIT' tid:32349, ticks:280627
  { tid:32349, addr:0x7f8675a00910, length:0x4 }
}
{
  real_time:17289.018409 global_time:72649, event:`EXIT' tid:32347, ticks:210832
  { tid:32347, addr:0x7f8677200910, length:0x4 }
}
{
  real_time:17289.018472 global_time:72650, event:`EXIT' tid:32348, ticks:590798
}
{
  real_time:17289.024946 global_time:72651, event:`SYSCALLBUF_FLUSH' tid:32162, ticks:4018613934
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'gettimeofday', ret:0x0, size:0x20 }
  { syscall:'gettimeofday', ret:0x0, size:0x20 }
  { syscall:'gettimeofday', ret:0x0, size:0x20 }
  { syscall:'gettimeofday', ret:0x0, size:0x20 }
  { syscall:'gettimeofday', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'gettimeofday', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'gettimeofday', ret:0x0, size:0x20 }
  { syscall:'gettimeofday', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'gettimeofday', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'write', ret:0x1, size:0x10, desched:1 }
  { syscall:'futex', ret:0x1, size:0x14 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'gettimeofday', ret:0x0, size:0x20 }
  { syscall:'gettimeofday', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'poll', ret:0x2, size:0x38 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'recvmsg', ret:0x24, size:0x10c, desched:1 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'futex', ret:0x1, size:0x14 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'sendmsg', ret:0x84, size:0x10, desched:1 }
  { syscall:'read', ret:0x1, size:0x11, desched:1 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'sendmsg', ret:0x14, size:0x10, desched:1 }
  { syscall:'poll', ret:0x0, size:0x38 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'write', ret:0x1, size:0x10, desched:1 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'poll', ret:0x1, size:0x38 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'read', ret:0x1, size:0x11, desched:1 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'poll', ret:0x0, size:0x38 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'write', ret:0x1, size:0x10, desched:1 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'gettimeofday', ret:0x0, size:0x20 }
  { syscall:'gettimeofday', ret:0x0, size:0x20 }
  { syscall:'gettimeofday', ret:0x0, size:0x20 }
  { syscall:'gettimeofday', ret:0x0, size:0x20 }
  { syscall:'gettimeofday', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'gettimeofday', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'gettimeofday', ret:0x0, size:0x20 }
  { syscall:'gettimeofday', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'gettimeofday', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'gettimeofday', ret:0x0, size:0x20 }
  { syscall:'gettimeofday', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'poll', ret:0x1, size:0x38 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'read', ret:0x1, size:0x11, desched:1 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'poll', ret:0x0, size:0x38 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'write', ret:0x1, size:0x10, desched:1 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'gettimeofday', ret:0x0, size:0x20 }
  { syscall:'gettimeofday', ret:0x0, size:0x20 }
  { syscall:'gettimeofday', ret:0x0, size:0x20 }
}
{
  real_time:17289.024957 global_time:72652, event:`SCHED' tid:32162, ticks:4018613934
rax:0x90740 rbx:0x7a21c3d00000 rcx:0x7a21c3801001 rdx:0x0 rsi:0x90740 rdi:0x7a217f390740 rbp:0x7ffcd3200a10 rsp:0x7ffcd32009e0 r8:0x7a21c392d820 r9:0x7a646bca r10:0x7a21b4cf64b0 r11:0x131 r12:0x7a217f300000 r13:0x90740 r14:0x7a217f390740 r15:0x0 rip:0x5c16f94d13e7 eflags:0x246 cs:0x33 ss:0x2b ds:0x0 es:0x0 fs:0x0 gs:0x0 orig_rax:0xffffffffffffffff fs_base:0x7a21c4065780 gs_base:0x7a1c00000000
}
{
  real_time:17289.024961 global_time:72653, event:`SYSCALLBUF_RESET' tid:32162, ticks:4018613934
}
{
  real_time:17289.026434 global_time:72654, event:`SYSCALL: poll' (state:EXITING_SYSCALL) tid:32166, ticks:285502
rax:0x1 rbx:0x7a21af9fffa0 rcx:0xffffffffffffffff rdx:0x7530 rsi:0x3 rdi:0x7a21b01ffcb0 rbp:0x7a21b01ffd10 rsp:0x7a21af9ffdf0 r8:0x0 r9:0xff r10:0x7a217f300018 r11:0x246 r12:0x7a21c3916501 r13:0x7a21b01ffcc0 r14:0x7a21b01ffcb0 r15:0x3 rip:0x70000002 eflags:0x246 cs:0x33 ss:0x2b ds:0x0 es:0x0 fs:0x0 gs:0x0 orig_rax:0x7 fs_base:0x7a21b0200640 gs_base:0x0
  { tid:32166, addr:0x7a21b01ffcb0, length:0x18 }
}
{
  real_time:17289.026494 global_time:72655, event:`SYSCALL: ioctl' (state:ENTERING_SYSCALL) tid:32166, ticks:285524
rax:0xffffffffffffffda rbx:0x7a21c3934700 rcx:0xffffffffffffffff rdx:0x7a21b01ffc9c rsi:0x541b rdi:0x10 rbp:0x7a21b01ffcd0 rsp:0x7a21b01ffc10 r8:0x7a21c3934740 r9:0x7a21c3934758 r10:0x7a217f300018 r11:0x246 r12:0x10 r13:0x2 r14:0x7a21c3934740 r15:0x7a21b12f4c50 rip:0x7a21c3b1a94f eflags:0x246 cs:0x33 ss:0x2b ds:0x0 es:0x0 fs:0x0 gs:0x0 orig_rax:0x10 fs_base:0x7a21b0200640 gs_base:0x0
}
{
  real_time:17289.026523 global_time:72656, event:`SYSCALL: ioctl' (state:EXITING_SYSCALL) tid:32166, ticks:285524
rax:0x0 rbx:0x7a21c3934700 rcx:0xffffffffffffffff rdx:0x7a21b01ffc9c rsi:0x541b rdi:0x10 rbp:0x7a21b01ffcd0 rsp:0x7a21b01ffc10 r8:0x7a21c3934740 r9:0x7a21c3934758 r10:0x7a217f300018 r11:0x246 r12:0x10 r13:0x2 r14:0x7a21c3934740 r15:0x7a21b12f4c50 rip:0x7a21c3b1a94f eflags:0x246 cs:0x33 ss:0x2b ds:0x0 es:0x0 fs:0x0 gs:0x0 orig_rax:0x10 fs_base:0x7a21b0200640 gs_base:0x0
  { tid:32166, addr:0x7a21b01ffc9c, length:0x4 }
}
{
  real_time:17289.026586 global_time:72657, event:`SYSCALLBUF_FLUSH' tid:32166, ticks:286052
  { syscall:'clock_gettime', ret:0x0, size:0x20 }
  { syscall:'recvmsg', ret:0x8, size:0xe0, desched:1 }
  { syscall:'sendmsg', ret:0x8, size:0x10, desched:1 }
}
{
  real_time:17289.026591 global_time:72658, event:`SYSCALL: ioctl' (state:ENTERING_SYSCALL) tid:32166, ticks:286052
rax:0xffffffffffffffda rbx:0x2 rcx:0xffffffffffffffff rdx:0x7a21b01ffc9c rsi:0x541b rdi:0x10 rbp:0x7a21b01ffcd0 rsp:0x7a21b01ffc10 r8:0x1000 r9:0xff r10:0x7a217f300018 r11:0x246 r12:0x10 r13:0x0 r14:0x0 r15:0x7a219409f680 rip:0x7a21c3b1a94f eflags:0x246 cs:0x33 ss:0x2b ds:0x0 es:0x0 fs:0x0 gs:0x0 orig_rax:0x10 fs_base:0x7a21b0200640 gs_base:0x0
}
{
  real_time:17289.026594 global_time:72659, event:`SYSCALLBUF_RESET' tid:32166, ticks:286052
}
=== Start rr backtrace:
rr(_ZN2rr13dump_rr_stackERNS_8ScopedFdE+0x5b)[0x591ef3d0ec2b]
rr(_ZN2rr15emergency_debugEPNS_4TaskE+0x152)[0x591ef3be0e22]
rr(+0xdf992)[0x591ef3be1992]
rr(+0xdff9f)[0x591ef3be1f9f]
rr(_ZN2rr10ReplayTask13validate_regsEj+0x1ed)[0x591ef3c8fcdd]
rr(_ZN2rr13ReplaySession13enter_syscallEPNS_10ReplayTaskERKNS0_15StepConstraintsE+0x3da)[0x591ef3c7a12a]
rr(_ZN2rr13ReplaySession18try_one_trace_stepEPNS_10ReplayTaskERKNS0_15StepConstraintsE+0xe3)[0x591ef3c819a3]
rr(_ZN2rr13ReplaySession11replay_stepERKNS0_15StepConstraintsE+0x21d)[0x591ef3c838ed]
rr(_ZN2rr13ReplayCommand3runERSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS7_EE+0x167c)[0x591ef3c76d1c]
rr(main+0x1a1)[0x591ef3b573c1]
/lib/x86_64-linux-gnu/libc.so.6(+0x29d90)[0x708a1fe29d90]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80)[0x708a1fe29e40]
rr(_start+0x25)[0x591ef3b59e55]
=== End rr backtrace

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 src/ReplayTask.cc:130 and validate_regs(), then reproduce with rr replay -a using the Firefox Nightly recording described in the report. Compare the replay/record register mismatch and the trace dump around global time 72658; done means the recording replays without the fatal assertion.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, linux
Domain
operating-systems, reverse-engineering, tooling
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.