Package: gdb
Version: 6.4-1
Severity: normal

> cat a.c
int main()
{
        return 0;
}
> rm -r b.c && touch b.c
> gcc -shared -o a.so a.c
> gcc -o a b.c a.so
> export LD_LIBRARY_PATH=`pwd`
> gdb ./a
...
(gdb) tb main
Breakpoint 1 at 0x8048384
(gdb) run
Starting program: /home/nikita/bug/a
Breakpoint 1 at 0xb7f6d66a
0xb7f6d66a in main () from /home/nikita/bug/a.so
(gdb) kill
Kill the program being debugged? (y or n) y
(gdb) file ./a
Load new symbol table from "/home/nikita/bug/a"? (y or n) y
Reading symbols from /home/nikita/bug/a...done.
(gdb) tb main
Cannot access memory at address 0xb7f6d664

Here, 'main' is defined in a shared library. As far as I understand, gdb
cached some information about a.so over 'file' command, but this
information got invalid.

This may be related to the fact that now on different executions of the same
program kernel maps same shared libraries at different addresses.

If program is executed at less once after 'file' command, problem disappears.
Also, problem disappears if 'nosharedlibrary' is entered before 'file'.

Note: the above command sequence is just a minimal example to trigger
the bug; initially we faced the bug in a complex environment, where gdb was
controlled by a wrapper script, and reloading file was required.

-- System Information:
Debian Release: 3.1
  APT prefers proposed-updates
  APT policy: (640, 'proposed-updates'), (640, 'stable'), (620, 
'testing-proposed-updates'), (620, 'testing'), (600, 'unstable'), (550, 
'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.15
Locale: LANG=ru_RU.KOI8-R, LC_CTYPE=ru_RU.KOI8-R (charmap=KOI8-R)

Versions of packages gdb depends on:
ii  libc6                         2.3.5-8    GNU C Library: Shared libraries an
ii  libncurses5                   5.5-1      Shared libraries for terminal hand
ii  libreadline5                  5.0-10     GNU readline and history libraries

gdb recommends no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to