This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: "Cannot find new threads" on Fedora 9, but not on CentOS 5 (?)


On Fri, Oct 31, 2008 at 7:29 PM, Andrew Lofthouse <loftyhauser@gmail.com> wrote:

> Last night I tried to follow your example and try to debug gdb, but to do
> so, I would have to replicate my earlier problem, but I was unable to do so
> (meaning, gdb did not have any problems following the new threads, or
> finding libpthread symbols).  I thought this was because I had explicitly
> linked with -pthread previously.  I rebooted, rebuilt, and was still unable
> to replicate the problem.  I re-installed Fedora 9 from scratch, and I'm
> still unable to replicate it.  I have no idea what changed.

Don't you just hate that?

One thing that may have changed is prelink addresses --
IIRC, Fedora runs prelink at 2 week intervals.

You may want to try:

  /usr/sbin/prelink -a
  gdb ...

several times, and see if one particular randomized layout
triggers the bug again.

> Ubuntu 8.04, however, still gives a "cannot find new threads: generic error"
> when not explicitly linking to libpthread.

Are you running a 64-bit kernel perchance?

There is a known kernel bug related to ptrace()ing 32-bit processes,
and it sounds from your trace that that might be what you are hitting.

> So, the following comes from
> Ubuntu.  Unfortunately, I cannot find any debug symbols for gdb for Ubuntu
> (Fedora seems to have them).

It's worse: your GDB has been stripped :(

> For what it's worth:
>
> ==> andrew@ubuntu-vm ~/codes/ufs Fri Oct 31 22:17:01
> 532 $ gdb -ex 'set prompt (top) ' --args gdb /usr/local/bin/ufs2oogl2D
> GNU gdb 6.8-debian
> Copyright (C) 2008 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later
> <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "i486-linux-gnu"...
> (no debugging symbols found)
> (top) rbreak throw_
> Breakpoint 1 at 0x8132024
> <function, no debug info> throw_exception;
> Breakpoint 2 at 0x8132136
> <function, no debug info> throw_error;
> Breakpoint 3 at 0x8132158
> <function, no debug info> throw_vfatal;
> Breakpoint 4 at 0x8132176
> <function, no debug info> throw_verror;
> Breakpoint 5 at 0x8132196
> <function, no debug info> deprecated_throw_reason;
> (top) run
> Starting program: /usr/bin/gdb /usr/local/bin/ufs2oogl2D
> (no debugging symbols found)
> (no debugging symbols found)
> (no debugging symbols found)
> (no debugging symbols found)
> (no debugging symbols found)
> [Thread debugging using libthread_db enabled]
> [New Thread 0xb7d396b0 (LWP 31952)]
> GNU gdb 6.8-debian
> Copyright (C) 2008 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later
> <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "i486-linux-gnu"...
> (gdb) set verbose on
> (gdb) run -T "rho" < UAM10_002_UFS-005000.sim > test.plt
> Starting program: /usr/local/bin/ufs2oogl2D -T "rho" <
> UAM10_002_UFS-005000.sim > test.plt
> Reading symbols from /lib/ld-linux.so.2...Reading symbols from
> /usr/lib/debug/lib/ld-2.7.so...done.
> done.
> Reading symbols from system-supplied DSO at 0xb7f0e000...done.
> Reading symbols from /usr/local/lib/libufs2D-0.9.so.2...done.
> Reading symbols from /usr/local/lib/libgts-0.7.so.5...done.
> Reading symbols from /usr/lib/libgmodule-2.0.so.0...Reading symbols from
> /usr/lib/debug/usr/lib/libgmodule-2.0.so.0.1600.6...done.
> done.
> Reading symbols from /usr/lib/debug/libdl.so.2...done.
> Reading symbols from /usr/lib/libglib-2.0.so.0...Reading symbols from
> /usr/lib/debug/usr/lib/libglib-2.0.so.0.1600.6...done.
> done.
> Reading symbols from /usr/lib/debug/libm.so.6...done.
> Reading symbols from /usr/lib/debug/libc.so.6...done.
> Reading symbols from /usr/lib/libpcre.so.3...Reading symbols from
> /usr/lib/debug/usr/lib/libpcre.so.3.12.1...done.
> done.
>
> Detaching after fork from child process 31962.
> Reading symbols from /tmp/gfs2O2C03...done.
> Reading symbols from /usr/lib/libgthread-2.0.so.0...Reading symbols from
> /usr/lib/debug/usr/lib/libgthread-2.0.so.0.1600.6...done.
> done.
> Reading symbols from /usr/lib/debug/librt.so.1...done.
> Reading symbols from /usr/lib/debug/libpthread.so.0...done.
> [Thread debugging using libthread_db enabled]
> [Switching to Thread 0xb7d396b0 (LWP 31952)]
>
> Breakpoint 4, 0x08132176 in throw_verror ()
> (top) where
> #0  0x08132176 in throw_verror ()
> #1  0x0808f403 in error ()
> #2  0x080a2580 in ?? ()
> #3  0x080a3d4e in check_for_thread_db ()
> #4  0x0808782f in ?? ()
> #5  0x08087987 in observer_notify_new_objfile ()
> #6  0x08119aaa in ?? ()
> #7  0x0809aad0 in ?? ()
> #8  0x08132393 in catch_errors ()
> #9  0x0809a69c in solib_read_symbols ()
> #10 0x0809b062 in solib_add ()
> #11 0x081284eb in handle_inferior_event ()
> #12 0x08129f77 in wait_for_inferior ()
> #13 0x0812a147 in proceed ()
> #14 0x08124dc3 in ?? ()
> #15 0x0808b531 in execute_command ()
> #16 0x08135dff in ?? ()
> #17 0x08136b53 in ?? ()
> #18 0xb7f27962 in rl_callback_read_char () from /lib/libreadline.so.5
> #19 0x08135fcb in ?? ()
> #20 0x0813594e in ?? ()
> ---Type <return> to continue, or q <return> to quit---
> #21 0x08134d90 in ?? ()
> #22 0x08135630 in gdb_do_one_event ()
> #23 0x08132393 in catch_errors ()
> #24 0x080d63c4 in ?? ()
> #25 0x0813299f in current_interp_command_loop ()
> #26 0x0808330b in ?? ()
> #27 0x08132393 in catch_errors ()
> #28 0x08083c0c in ?? ()
> #29 0x08132393 in catch_errors ()
> #30 0x080832f1 in gdb_main ()
> #31 0x080832b5 in main ()
> (top)
>
>
> If I have some more time, I'll see what else I can do.

You may want to build GDB from sources (either 6.8, or better
yet CVS head) on Ubuntu. Then we'll at least have a complete
stack trace.

>  But, I do at least have a work-around...

Yes, but we still don't know if there is a GDB bug hiding underneath ...

Cheers,
-- 
Paul Pluzhnikov


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]