Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GDB backtrace on breakpoints doesn't show up #3694

Open
midenok opened this issue Feb 18, 2024 · 2 comments
Open

GDB backtrace on breakpoints doesn't show up #3694

midenok opened this issue Feb 18, 2024 · 2 comments

Comments

@midenok
Copy link

midenok commented Feb 18, 2024

Looks like #3547 fix is not full.

The below reproduces on 5.7.0 Debian release and latest master revision cbab5f7 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
@midenok
Copy link
Author

midenok commented Apr 12, 2024

Any news?

@rocallahan
Copy link
Collaborator

I've had a brief look at this. It's not the same bug as before, because I can reproduce it with all to_string parameters set to false. Also, this bug is strange because the backtrace appears on stdout but not in the file produced by set logging file. Figuring this out is going to require more debugging of gdb itself, which I'm not currently motivated to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants