NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

port-arm/55703: GDB single step fails for arm in shared library



>Number:         55703
>Category:       port-arm
>Synopsis:       GDB single step fails for arm in shared library
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-arm-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Oct 08 09:05:00 +0000 2020
>Originator:     Rin Okuyama
>Release:        9.99.73
>Organization:
Department of Physics, Meiji University
>Environment:
NetBSD cubietruck 9.99.73 NetBSD 9.99.73 (GENERICEB) #8: Mon Oct  5 17:26:07 JST 2020  rin@latipes:/sys/arch/evbarm/compile/GENERICEB evbarm earmv7hfeb
(occurs also for little endian)
>Description:
For arm, GDB fails to single-step into shared library on system built with
MKDEBUG=yes:

----
# gdb ./hello
GNU gdb (GDB) 8.3
...
Reading symbols from ./hello...
(gdb) b main
Breakpoint 1 at 0x106a4: file hello.c, line 7.
(gdb) r
Starting program: /root/hello

Breakpoint 1, main () at hello.c:7
7               printf("Hello, World!\n");
(gdb) s
puts (s=0x10774 "Hello, World!") at /usr/src/lib/libc/stdio/puts.c:61
61      /usr/src/lib/libc/stdio/puts.c: No such file or directory.
(gdb)
68      in /usr/src/lib/libc/stdio/puts.c
(gdb)
...
_mmap (addr=0x0, len=69632, prot=3, flags=4098, fd=-1, offset=0)
    at /usr/src/lib/libc/sys/mmap.c:61
61      /usr/src/lib/libc/sys/mmap.c: No such file or directory.
(gdb)


0x6dc72144 in __mmap () from /usr/lib/libc.so.12
(gdb)
Single stepping until exit from function __mmap,
which has no line number information.
Warning:
Cannot insert breakpoint 0.
Cannot access memory at address 0x0


(gdb)
Single stepping until exit from function __mmap,
which has no line number information.
Warning:
Cannot insert breakpoint 0.
Cannot access memory at address 0x0

(gdb)
...
----

For armv5hf{,eb}, GDB crashes after trying to insert breakpoint to 0
with ``gdb_exception_RETURN_MASK_ERROR'', if compiled by GCC 9.3.
This crash can be avoided if breakpoint.c and ifrun.c are compiled with
-O0, or -O2 by GCC8, but it still fails to single-step further anyway.

Also, if breakpoint is inserted directly to __mmap, GDB freezes
indefinitely, without capable of terminated by ^C or ^\. It accepts
only SIGKILL:

----
# gdb ./hello
GNU gdb (GDB) 8.3
...
Reading symbols from ./hello...
(gdb) b __mmap
Function "__mmap" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (__mmap) pending.
(gdb) r
Starting program: /root/hello

Breakpoint 1, 0x7973bf58 in __mmap () from /usr/libexec/ld.elf_so
(gdb) s
Single stepping until exit from function __mmap,
which has no line number information.
Warning:
Cannot insert breakpoint 0.
Cannot access memory at address 0x0

(gdb)
Single stepping until exit from function __mmap,
which has no line number information.
^C^C^C^\^\^\[ 260553.7405450] sorry, pid 10026 was killed: orphaned traced process
[1]   Killed                  gdb ./hello
#
----
>How-To-Repeat:
Described above.
>Fix:
N/A



Home | Main Index | Thread Index | Old Index