rr-debugger / rr-debugger/rr

GDB backtrace on breakpoints doesn't show up

Open
#3,694 2 comments 1 reaction 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

Looks like #3547 fix is not full.

The below reproduces on 5.7.0 Debian release and latest master revision cbab5f75 with any GDB v8-v14. GDB alone works just fine as well as with RR 5.6.0!

Reproduce
#!/bin/bash
cat << EOF > /tmp/rrepro.c
#include <stdio.h>
int main() {
    puts("nice");
}
EOF

gcc /tmp/rrepro.c -o /tmp/rrepro -g3 -O0
rr /tmp/rrepro

cat << EOF > /tmp/rrepro.gdb
set debuginfod enabled off
b puts
commands
    echo ::Print start\n
    print str
    echo ::Backtrace start\n
    backtrace
    echo ::Backtrace end\n
    continue
end
set logging file /tmp/rrepro.log
set logging overwrite on
set logging enabled on
EOF

echo
echo ==Here comes replay execution
rr replay -- -x /tmp/rrepro.gdb -ex continue -nh --batch
echo
echo ==Here what we got into log
cat /tmp/rrepro.log
Result
rr: Saving execution to trace directory `/home/midenok/.local/share/rr/rrepro-18'.
nice

==Here comes replay execution
Really redefine built-in command "restart"? (y or n) [answered Y; input not from terminal]
Really redefine built-in command "jump"? (y or n) [answered Y; input not from terminal]
Breakpoint 1 at 0x1050
BFD: warning: system-supplied DSO at 0x6fffd000 has a section extending past end of file
0x00007f572421ed90 in _start () from /lib64/ld-linux-x86-64.so.2

Breakpoint 1, __GI__IO_puts (str=0x55da82882004 "nice") at ./libio/ioputs.c:33
warning: 33     ./libio/ioputs.c: No such file or directory
::Print start
$1 = 0x55da82882004 "nice"
::Backtrace start
#0  __GI__IO_puts (str=0x55da82882004 "nice") at ./libio/ioputs.c:33
#1  0x000055da82881160 in main () at /tmp/rrepro.c:3
::Backtrace end
nice

Program received signal SIGKILL, Killed.
0x0000000070000002 in syscall_traced ()
[Inferior 1 (process 3891308) detached]

==Here what we got into log
0x00007f572421ed90 in _start () from /lib64/ld-linux-x86-64.so.2

Breakpoint 1, __GI__IO_puts (str=0x55da82882004 "nice") at ./libio/ioputs.c:33
warning: 33     ./libio/ioputs.c: No such file or directory
::Print start
$1 = 0x55da82882004 "nice"
::Backtrace start
::Backtrace end

Program received signal SIGKILL, Killed.
0x0000000070000002 in syscall_traced ()
[Inferior 1 (process 3891308) detached]
Expected

/tmp/rrepro.log must contain:

::Backtrace start
#0  __GI__IO_puts (str=0x557ae5594004 "nice") at ./libio/ioputs.c:33
#1  0x0000557ae5593160 in main () at /tmp/rrepro.c:3
::Backtrace end

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

Run the provided /tmp/rrepro.c and /tmp/rrepro.gdb reproduction with rr 5.7.0 or the cited master revision and GDB 8–14 on Debian. Compare /tmp/rrepro.log with the expected output, focusing on why the breakpoint backtrace is absent from the logged replay output. Done means the log includes both expected backtrace frames between the Backtrace markers.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, linux
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.