NetBSD-Bugs archive

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

toolchain/50773: GDB single stepping fails for dynamically linked binary on armbe



>Number:         50773
>Category:       toolchain
>Synopsis:       GDB single stepping fails for dynamically linked binary on armbe
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Feb 05 23:45:00 +0000 2016
>Originator:     Rin Okuyama
>Release:        7.99.26
>Organization:
Department of Physics, Tohoku University
>Environment:
NetBSD XXX 7.99.26 NetBSD 7.99.26 (CUBIETRUCK) #0: Sat Feb  6 00:44:25 JST 2016  rin@XXX:XXX evbarm
>Description:
On armeb, single stepping of GDB works for statically linked binaries:

  % uname -pr
  7.99.26 earmv7hfeb
  % cc -g -O0 -static -o hello_s hello.c
  % gdb ./hello_s
  ...
  Reading symbols from ./hello_s...done.
  (gdb) b main
  Breakpoint 1 at 0x103c4: file hello.c, line 7.
  (gdb) r
  Starting program: /home/rin/hello_s

  Breakpoint 1, main () at hello.c:7
  7               printf("Hello, World!\n");
  (gdb) s
  Hello, World!
  8               return 0;
  (gdb) s
  9       }
  (gdb) s
  0x00010328 in ___start ()
  (gdb) s
  Single stepping until exit from function ___start,
  which has no line number information.
  [Inferior 1 (process 573) exited normally]
  (gdb)

However, it does not work for dynamically linked binaries:

  % cc -g -O0 -o hello_d hello.c
  % gdb ./hello_d
  ...
  Reading symbols from ./hello_d...done.
  (gdb) b main
  Breakpoint 1 at 0x107a4: file hello.c, line 7.
  (gdb) r
  Starting program: /home/rin/hello_d

  Breakpoint 1, main () at hello.c:7
  7               printf("Hello, World!\n");
  (gdb) s

Then, nothing was outputted further. After interrupting by Ctrl-C,
I took backtrace, which indicates infinite recursive in ld.elf_so:

  (gdb) s
  ^C
  Program received signal SIGINT, Interrupt.
  0x7bfdc60c in atomic_cas_ulong_ni () from /usr/libexec/ld.elf_so
  (gdb) bt
  #0  0x7bfdc60c in atomic_cas_ulong_ni () from /usr/libexec/ld.elf_so
  #1  0x7bfd33d0 in _rtld_shared_enter () from /usr/libexec/ld.elf_so
  #2  0x7bfd1fd4 in _rtld_bind () from /usr/libexec/ld.elf_so
  #3  0x7bfd1b44 in _rtld_bind_start () from /usr/libexec/ld.elf_so
  #4  0x7bfd1b44 in _rtld_bind_start () from /usr/libexec/ld.elf_so
  #5  0x7bfd1b44 in _rtld_bind_start () from /usr/libexec/ld.elf_so
  ...

Note that this problem occurs both for GDB 7.9.1 and 7.10.1. I guess
this is a similar problem to toolchain/49445.
>How-To-Repeat:
described above
>Fix:
n/a



Home | Main Index | Thread Index | Old Index