rr-debugger / rr-debugger/rr

`5.9.0-4.fc43`'s `debug` command hangs on an “rr backtrace” when invoked with `discord-canary-openasar-0.0.838-1`'s `DiscordCanary` binary as its sole argument.

Open
#4,036 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

Reported here, per reddit.com/r/archlinux/comments/sjqi4t/comment/nv2x5yx.

Conducted Preparation
RokeJulianLockhart@Beedell:~$ wget https://github.com/rr-debugger/rr/raw/858a036359520ea9979d4850f4cee567e6d2c8c9/scripts/zen_workaround.py
HTTP response 302  [https://github.com/rr-debugger/rr/raw/858a036359520ea9979d4850f4cee567e6d2c8c9/scripts/zen_workaround.py]
Adding URL: https://raw.githubusercontent.com/rr-debugger/rr/858a036359520ea9979d4850f4cee567e6d2c8c9/scripts/zen_workaround.py
Adding URL: https://raw.githubusercontent.com/rr-debugger/rr/858a036359520ea9979d4850f4cee567e6d2c8c9/scripts/zen_workaround.py
Saving 'zen_workaround.py'
HTTP response 200  [https://raw.githubusercontent.com/rr-debugger/rr/858a036359520ea9979d4850f4cee567e6d2c8c9/scripts/zen_workaround.py]
zen_workaround.py    100% [=========================================================================================================================================================================================================================================================================>]    1.83K    --.-KB/s
                          [Files: 1  Bytes: 1.83K [3.60KB/s] Redirects: 1  Todo: 0  Errors: 0
RokeJulianLockhart@Beedell:~$ chmod +x $HOME/Downloads/zen_workaround.py
RokeJulianLockhart@Beedell:~$ sudo $HOME/Downloads/zen_workaround.py
Zen workaround in place

[^1]: [blob/858a036359520ea9979d4850f4cee567e6d2c8c9/scripts/zen_workaround.py#L1C1-L164C98](https://github.com/rr-debugger/rr/blob/858a036359520ea9979d4850f4cee567e6d2c8c9/scripts/zen_workaround.py#L1C1-L164C98:~:text=/-,zen_workaround.py,-Latest commit) ^2

The Problem

When rr debug, from rr-5.9.0-4.fc43.x86_64.rpm is invoked on /usr/share/discord-canary-openasar/DiscordCanary, from discord-canary-openasar-0.0.838-1.fc43.x86_64.rpm, it hangs, with a crash trace:

RokeJulianLockhart@Beedell:~$ time rr record /usr/share/discord-canary-openasar/DiscordCanary
rr: Saving execution to trace directory `/home/RokeJulianLockhart/.local/share/rr/DiscordCanary-6'.
[FATAL src/record_syscall.cc:6754:rec_process_syscall_arch()] 
 (task 193980 (rec:193980) at time 1948)
 -> Assertion `t->regs().syscall_result_signed() == -syscall_state.expect_errno' failed to hold. Expected EINVAL for 'madvise' but got result 0 (errno SUCCESS); unknown madvise(102)
Tail of trace dump:
{
  real_time:25624.020258 global_time:1928, event:`SYSCALLBUF_RESET' tid:193980, ticks:12176189
}
{
  real_time:25624.020297 global_time:1929, event:`SYSCALLBUF_FLUSH' tid:193980, ticks:12176213
  { syscall:'socketpair', ret:0x0, size:0x18 }
}
{
  real_time:25624.020321 global_time:1930, event:`PATCH_SYSCALL' tid:193980, ticks:12176213
rax:0x30 rbx:0x55e06096b358 rcx:0xffffffffffffffff rdx:0x0 rsi:0x0 rdi:0x5 rbp:0x7ffcb4ab6a20 rsp:0x7ffcb4ab69c8 r8:0x0 r9:0x0 r10:0x7ffcb4ab69f0 r11:0x246 r12:0xffffffff r13:0x55e0607102b0 r14:0x0 r15:0xaaaaaaaaaaaaaaaa rip:0x7feb5b1c3269 eflags:0x246 cs:0x33 ss:0x2b ds:0x0 es:0x0 fs:0x0 gs:0x0 orig_rax:0xffffffffffffffff fs_base:0x7feb5a464380 gs_base:0x0
  { tid:193980, addr:0x7feb5cb37758, length:0x5e }
  { tid:193980, addr:0x7feb5b1c3269, length:0x8 }
}
{
  real_time:25624.020326 global_time:1931, event:`SYSCALLBUF_RESET' tid:193980, ticks:12176213
}
{
  real_time:25624.020351 global_time:1932, event:`SYSCALL: shutdown' (state:ENTERING_SYSCALL) tid:193980, ticks:12176222
rax:0xffffffffffffffda rbx:0x681fffa0 rcx:0xffffffffffffffff rdx:0x0 rsi:0x0 rdi:0x5 rbp:0x681ffe40 rsp:0x681ffde0 r8:0x0 r9:0x0 r10:0x7ffcb4ab69f0 r11:0x246 r12:0xffffffff r13:0x55e0607102b0 r14:0x0 r15:0xaaaaaaaaaaaaaaaa rip:0x70000002 eflags:0x246 cs:0x33 ss:0x2b ds:0x0 es:0x0 fs:0x0 gs:0x0 orig_rax:0x30 fs_base:0x7feb5a464380 gs_base:0x0
}
{
  real_time:25624.020370 global_time:1933, event:`SYSCALL: shutdown' (state:EXITING_SYSCALL) tid:193980, ticks:12176222
rax:0x0 rbx:0x681fffa0 rcx:0xffffffffffffffff rdx:0x0 rsi:0x0 rdi:0x5 rbp:0x681ffe40 rsp:0x681ffde0 r8:0x0 r9:0x0 r10:0x7ffcb4ab69f0 r11:0x246 r12:0xffffffff r13:0x55e0607102b0 r14:0x0 r15:0xaaaaaaaaaaaaaaaa rip:0x70000002 eflags:0x246 cs:0x33 ss:0x2b ds:0x0 es:0x0 fs:0x0 gs:0x0 orig_rax:0x30 fs_base:0x7feb5a464380 gs_base:0x0
}
{
  real_time:25624.020394 global_time:1934, event:`SYSCALL: shutdown' (state:ENTERING_SYSCALL) tid:193980, ticks:12176236
rax:0xffffffffffffffda rbx:0x681fffa0 rcx:0xffffffffffffffff rdx:0x0 rsi:0x1 rdi:0x6 rbp:0x681ffe40 rsp:0x681ffde0 r8:0x0 r9:0x0 r10:0x7ffcb4ab69f0 r11:0x246 r12:0xffffffff r13:0x55e0607102b0 r14:0x6 r15:0xaaaaaaaaaaaaaaaa rip:0x70000002 eflags:0x246 cs:0x33 ss:0x2b ds:0x0 es:0x0 fs:0x0 gs:0x0 orig_rax:0x30 fs_base:0x7feb5a464380 gs_base:0x0
}
{
  real_time:25624.020412 global_time:1935, event:`SYSCALL: shutdown' (state:EXITING_SYSCALL) tid:193980, ticks:12176236
rax:0x0 rbx:0x681fffa0 rcx:0xffffffffffffffff rdx:0x0 rsi:0x1 rdi:0x6 rbp:0x681ffe40 rsp:0x681ffde0 r8:0x0 r9:0x0 r10:0x7ffcb4ab69f0 r11:0x246 r12:0xffffffff r13:0x55e0607102b0 r14:0x6 r15:0xaaaaaaaaaaaaaaaa rip:0x70000002 eflags:0x246 cs:0x33 ss:0x2b ds:0x0 es:0x0 fs:0x0 gs:0x0 orig_rax:0x30 fs_base:0x7feb5a464380 gs_base:0x0
}
{
  real_time:25624.020456 global_time:1936, event:`PATCH_SYSCALL' tid:193980, ticks:12176241
rax:0x125 rbx:0x55e06096b358 rcx:0xffffffffffffffff rdx:0x0 rsi:0x0 rdi:0x7ffcb4ab69f8 rbp:0x7ffcb4ab6a20 rsp:0x7ffcb4ab69c8 r8:0x0 r9:0x0 r10:0x7ffcb4ab69f0 r11:0x246 r12:0xffffffff r13:0x55e0607102b0 r14:0x6 r15:0xaaaaaaaaaaaaaaaa rip:0x7feb5b1b411b eflags:0x246 cs:0x33 ss:0x2b ds:0x0 es:0x0 fs:0x0 gs:0x0 orig_rax:0xffffffffffffffff fs_base:0x7feb5a464380 gs_base:0x0
  { tid:193980, addr:0x7feb5cb377b6, length:0x5e }
  { tid:193980, addr:0x7feb5b1b411b, length:0x8 }
}
{
  real_time:25624.020480 global_time:1937, event:`SYSCALL: pipe2' (state:ENTERING_SYSCALL) tid:193980, ticks:12176251
rax:0xffffffffffffffda rbx:0x681fffa0 rcx:0xffffffffffffffff rdx:0x0 rsi:0x0 rdi:0x7ffcb4ab69f8 rbp:0x681ffe40 rsp:0x681ffde0 r8:0x0 r9:0x0 r10:0x7ffcb4ab69f0 r11:0x246 r12:0xffffffff r13:0x55e0607102b0 r14:0x6 r15:0xaaaaaaaaaaaaaaaa rip:0x70000002 eflags:0x246 cs:0x33 ss:0x2b ds:0x0 es:0x0 fs:0x0 gs:0x0 orig_rax:0x125 fs_base:0x7feb5a464380 gs_base:0x0
}
{
  real_time:25624.020505 global_time:1938, event:`SYSCALL: pipe2' (state:EXITING_SYSCALL) tid:193980, ticks:12176251
rax:0x0 rbx:0x681fffa0 rcx:0xffffffffffffffff rdx:0x0 rsi:0x0 rdi:0x7ffcb4ab69f8 rbp:0x681ffe40 rsp:0x681ffde0 r8:0x0 r9:0x0 r10:0x7ffcb4ab69f0 r11:0x246 r12:0xffffffff r13:0x55e0607102b0 r14:0x6 r15:0xaaaaaaaaaaaaaaaa rip:0x70000002 eflags:0x246 cs:0x33 ss:0x2b ds:0x0 es:0x0 fs:0x0 gs:0x0 orig_rax:0x125 fs_base:0x7feb5a464380 gs_base:0x0
  { tid:193980, addr:0x7ffcb4ab69f8, length:0x8 }
}
{
  real_time:25624.020531 global_time:1939, event:`SYSCALL: rt_sigaction' (state:ENTERING_SYSCALL) tid:193980, ticks:12176377
rax:0xffffffffffffffda rbx:0x681fffa0 rcx:0xffffffffffffffff rdx:0x0 rsi:0x7ffcb4ab6530 rdi:0x21 rbp:0x681ffe40 rsp:0x681ffde0 r8:0x0 r9:0x7e0000b62e0 r10:0x8 r11:0x246 r12:0xfffffffc00000000 r13:0x1 r14:0x7e0000b62e0 r15:0x2 rip:0x70000002 eflags:0x246 cs:0x33 ss:0x2b ds:0x0 es:0x0 fs:0x0 gs:0x0 orig_rax:0xd fs_base:0x7feb5a464380 gs_base:0x0
}
{
  real_time:25624.020551 global_time:1940, event:`SYSCALL: rt_sigaction' (state:EXITING_SYSCALL) tid:193980, ticks:12176377
rax:0x0 rbx:0x681fffa0 rcx:0xffffffffffffffff rdx:0x0 rsi:0x7ffcb4ab6530 rdi:0x21 rbp:0x681ffe40 rsp:0x681ffde0 r8:0x0 r9:0x7e0000b62e0 r10:0x8 r11:0x246 r12:0xfffffffc00000000 r13:0x1 r14:0x7e0000b62e0 r15:0x2 rip:0x70000002 eflags:0x246 cs:0x33 ss:0x2b ds:0x0 es:0x0 fs:0x0 gs:0x0 orig_rax:0xd fs_base:0x7feb5a464380 gs_base:0x0
}
{
  real_time:25624.020579 global_time:1941, event:`SYSCALL: rt_sigprocmask' (state:ENTERING_SYSCALL) tid:193980, ticks:12176383
rax:0xffffffffffffffda rbx:0x7e000006ca0 rcx:0xffffffffffffffff rdx:0x0 rsi:0x7ffcb4ab66f8 rdi:0x1 rbp:0x7ffcb4ab67c0 rsp:0x7ffcb4ab6680 r8:0x0 r9:0x7e0000b62e0 r10:0x8 r11:0x246 r12:0xfffffffc00000000 r13:0x1 r14:0x7e0000b62e0 r15:0x2 rip:0x7feb5b13ecbf eflags:0x246 cs:0x33 ss:0x2b ds:0x0 es:0x0 fs:0x0 gs:0x0 orig_rax:0xe fs_base:0x7feb5a464380 gs_base:0x0
}
{
  real_time:25624.020597 global_time:1942, event:`SYSCALL: rt_sigprocmask' (state:EXITING_SYSCALL) tid:193980, ticks:12176383
rax:0x0 rbx:0x7e000006ca0 rcx:0xffffffffffffffff rdx:0x0 rsi:0x7ffcb4ab66f8 rdi:0x1 rbp:0x7ffcb4ab67c0 rsp:0x7ffcb4ab6680 r8:0x0 r9:0x7e0000b62e0 r10:0x8 r11:0x246 r12:0xfffffffc00000000 r13:0x1 r14:0x7e0000b62e0 r15:0x2 rip:0x7feb5b13ecbf eflags:0x246 cs:0x33 ss:0x2b ds:0x0 es:0x0 fs:0x0 gs:0x0 orig_rax:0xe fs_base:0x7feb5a464380 gs_base:0x0
}
{
  real_time:25624.020610 global_time:1943, event:`PATCH_SYSCALL' tid:193980, ticks:12176383
rax:0x0 rbx:0x7e000006ca0 rcx:0xffffffffffffffff rdx:0x0 rsi:0x7ffcb4ab66f8 rdi:0x1 rbp:0x7ffcb4ab67c0 rsp:0x7ffcb4ab6680 r8:0x0 r9:0x7e0000b62e0 r10:0x8 r11:0x246 r12:0xfffffffc00000000 r13:0x1 r14:0x7e0000b62e0 r15:0x2 rip:0x7feb5b13ecbf eflags:0x246 cs:0x33 ss:0x2b ds:0x0 es:0x0 fs:0x0 gs:0x0 orig_rax:0xe fs_base:0x7feb5a464380 gs_base:0x0
  { tid:193980, addr:0x7feb5cb37814, length:0x5e }
  { tid:193980, addr:0x7feb5b13ecb8, length:0x7 }
}
{
  real_time:25624.020635 global_time:1944, event:`SYSCALL: mmap' (state:ENTERING_SYSCALL) tid:193980, ticks:12176410
rax:0xffffffffffffffda rbx:0x681fffa0 rcx:0xffffffffffffffff rdx:0x3 rsi:0x801000 rdi:0x0 rbp:0x681ffe40 rsp:0x681ffde0 r8:0xffffffff r9:0x0 r10:0x20022 r11:0x246 r12:0x20022 r13:0x0 r14:0xffffffffffffffc0 r15:0x7feb5cbc0000 rip:0x70000002 eflags:0x246 cs:0x33 ss:0x2b ds:0x0 es:0x0 fs:0x0 gs:0x0 orig_rax:0x9 fs_base:0x7feb5a464380 gs_base:0x0
}
{
  real_time:25624.020662 global_time:1945, event:`SYSCALL: mmap' (state:EXITING_SYSCALL) tid:193980, ticks:12176410
rax:0x7feb4abff000 rbx:0x681fffa0 rcx:0xffffffffffffffff rdx:0x3 rsi:0x801000 rdi:0x0 rbp:0x681ffe40 rsp:0x681ffde0 r8:0xffffffff r9:0x0 r10:0x20022 r11:0x246 r12:0x20022 r13:0x0 r14:0xffffffffffffffc0 r15:0x7feb5cbc0000 rip:0x70000002 eflags:0x246 cs:0x33 ss:0x2b ds:0x0 es:0x0 fs:0x0 gs:0x0 orig_rax:0x9 fs_base:0x7feb5a464380 gs_base:0x0
  { map_file:"<ZERO>", addr:0x7feb4abff000, length:0x801000, prot_flags:"rw-p", file_offset:0x0, device:0, inode:0, data_file:"", data_offset:0x0, file_size:0x801000 }
}
{
  real_time:25624.020707 global_time:1946, event:`PATCH_SYSCALL' tid:193980, ticks:12176419
rax:0x1c rbx:0x7feb4b3ff6c0 rcx:0xffffffffffffffff rdx:0x66 rsi:0x1000 rdi:0x7feb4abff000 rbp:0x7ffcb4ab67c0 rsp:0x7ffcb4ab6678 r8:0xffffffff r9:0x0 r10:0x801000 r11:0x246 r12:0x7ffcb4ab6920 r13:0x0 r14:0xffffffffffffffc0 r15:0x7feb5cbc0000 rip:0x7feb5b1bd649 eflags:0x246 cs:0x33 ss:0x2b ds:0x0 es:0x0 fs:0x0 gs:0x0 orig_rax:0xffffffffffffffff fs_base:0x7feb5a464380 gs_base:0x0
  { tid:193980, addr:0x7feb5cb37872, length:0x5e }
  { tid:193980, addr:0x7feb5b1bd649, length:0x8 }
}
{
  real_time:25624.020732 global_time:1947, event:`SYSCALL: madvise' (state:ENTERING_SYSCALL) tid:193980, ticks:12176431
rax:0xffffffffffffffda rbx:0x681fffa0 rcx:0xffffffffffffffff rdx:0x66 rsi:0x1000 rdi:0x7feb4abff000 rbp:0x681ffe40 rsp:0x681ffde0 r8:0xffffffff r9:0x0 r10:0x801000 r11:0x246 r12:0x7ffcb4ab6920 r13:0x0 r14:0xffffffffffffffc0 r15:0x7feb5cbc0000 rip:0x70000002 eflags:0x246 cs:0x33 ss:0x2b ds:0x0 es:0x0 fs:0x0 gs:0x0 orig_rax:0x1c fs_base:0x7feb5a464380 gs_base:0x0
}
=== Start rr backtrace:
rr(_ZN2rr13dump_rr_stackERNS_8ScopedFdE+0x5b) [0x55b623601d3b]
rr(_ZN2rr15emergency_debugEPNS_4TaskE+0x1b5) [0x55b6234c1325]
rr(+0xc3b25) [0x55b6234c1b25]
rr(+0xc4c27) [0x55b6234c2c27]
rr(+0xc4c64) [0x55b6234c2c64]
rr(+0x12de3f) [0x55b62352be3f]
rr(_ZN2rr19rec_process_syscallEPNS_10RecordTaskE+0x1a5) [0x55b623518495]
rr(_ZN2rr13RecordSession21syscall_state_changedEPNS_10RecordTaskEPNS0_9StepStateE+0x9f8) [0x55b6234fcf98]
rr(_ZN2rr13RecordSession11record_stepEv+0x619) [0x55b623500aa9]
rr(_ZN2rr13RecordCommand3runERSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS7_EE+0x1021) [0x55b6234f2cc1]
rr(main+0x1ba) [0x55b62342708a]
/lib64/libc.so.6(+0x35b5) [0x7fcd1fbe45b5]
/lib64/libc.so.6(__libc_start_main+0x88) [0x7fcd1fbe4668]
rr(_start+0x25) [0x55b623428665]
=== End rr backtrace
Launch debugger with
  'gdb' '-l' '10000' '-ex' 'set sysroot /' '-ex' 'target extended-remote 127.0.0.1:62908' '/usr/share/discord-canary-openasar/DiscordCanary' 
^C


real    252m29.853s
user    0m0.159s
sys     0m0.368s
My Environment
  1. #!/usr/bin/env sh
    rpm -qi \
     $(rpm -qf $(command -v rr)) \
     $(rpm -qf /usr/share/discord-canary-openasar/DiscordCanary)
    
    • Name        : rr
      Version     : 5.9.0
      Release     : 4.fc43
      Architecture: x86_64
      Install Date: Sat 20 Dec 2025 13:01:56 GMT
      Size        : 4383412
      Signature   :
                    RSA/SHA256, Tue 12 Aug 2025 01:07:38 BST, Key ID 829b606631645531
      Source RPM  : rr-5.9.0-4.fc43.src.rpm
      Build Date  : Tue 12 Aug 2025 01:00:24 BST
      Build Host  : buildvm-x86-16.rdu3.fedoraproject.org
      Packager    : Fedora Project
      Vendor      : Fedora Project
      URL         : http://rr-project.org
      Bug URL     : https://bugz.fedoraproject.org/rr
      
    • Name        : discord-canary-openasar
      Version     : 0.0.838
      Release     : 1.fc43
      Architecture: x86_64
      Install Date: Sat 20 Dec 2025 12:27:48 GMT
      Size        : 269104501
      Signature   :
                    EdDSA/SHA256, Sat 20 Dec 2025 01:50:31 GMT, Key ID e43dbfe05c4f92a3
                    EdDSA/SHA256, Sat 20 Dec 2025 01:50:31 GMT, Key ID e43dbfe05c4f92a3
      Source RPM  : discord-canary-openasar-0.0.838-1.fc43.src.rpm
      Build Date  : Sat 20 Dec 2025 01:48:20 GMT
      Build Host  : 2a229bc7c1f5
      Vendor      : Terra
      URL         : https://github.com/GooseMod/OpenAsar
      
Context

I was attempting to debug GooseMod/OpenAsar/issues/224.

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 by reproducing the reported failure with rr record on /usr/share/discord-canary-openasar/DiscordCanary and review scripts/zen_workaround.py alongside the rr backtrace. Trace the madvise(102) handling that produces the EINVAL assertion, then verify that the command no longer hangs or aborts for this binary.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.