Bug#594740: gdb: wrong eval of strlen function when program is linked to eglibc

2010-08-31 Thread Daniel Jacobowitz
On Sat, Aug 28, 2010 at 11:55:01PM +0200, Alain Greppin wrote:
 Package: gdb
 Version: 6.8-3
 Severity: important
 
 sample output of gdb:
 Breakpoint 2, var_subst (
 s=0x7fffd73f /home/agreppin/src/tools/amake/amake, target=0x0, 
 req1=0x0) at var.c:154
 154 *a = '\0';
 (gdb) p n
 $1 = 36
 (gdb) p strlen(s)
 $2 = 1976916864

This bug is specific to STT_GNU_IFUNC.  What GDB is printing is
actually the return value of the indirect function, i.e. the address
of the actual strlen.

I believe some patches were posted for this upstream, but never in an
acceptable state.

-- 
Daniel Jacobowitz
CodeSourcery



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#594740: gdb: wrong eval of strlen function when program is linked to eglibc

2010-08-28 Thread Alain Greppin
Package: gdb
Version: 6.8-3
Severity: important

sample output of gdb:
Breakpoint 2, var_subst (
s=0x7fffd73f /home/agreppin/src/tools/amake/amake, target=0x0, 
req1=0x0) at var.c:154
154 *a = '\0';
(gdb) p n
$1 = 36
(gdb) p strlen(s)
$2 = 1976916864
---

But works as expected when the program is linked to dietlibc (static).
(same behavior observed on sid/386)

-- System Information:
Debian Release: 5.0.5
  APT prefers stable
  APT policy: (700, 'stable'), (650, 'testing'), (600, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.26-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

Versions of packages gdb depends on:
ii  libc6 2.11.2-2   Embedded GNU C Library: Shared lib
ii  libexpat1 2.0.1-4+lenny3 XML parsing C library - runtime li
ii  libncurses5   5.7+20100313-2 shared libraries for terminal hand
ii  libreadline5  5.2-3.1GNU readline and history libraries

gdb recommends no packages.

Versions of packages gdb suggests:
ii  gdb-doc   6.8-1  The GNU Debugger Documentation

-- no debconf information



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org