This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Thead problem with gdb 5.2 and glibc
- From: "H . J . Lu" <hjl at lucon dot org>
- To: GNU C Library <libc-alpha at sources dot redhat dot com>
- Cc: GDB <gdb at sources dot redhat dot com>
- Date: Thu, 30 May 2002 16:58:42 -0700
- Subject: Thead problem with gdb 5.2 and glibc
I have a strange thread problem with gdb 5.2 and glibc. I have a set of
DSOs, which are linked against linuxthreads. One of them has an
undefined symbol. With
int main(int argc, char **argv)
{
void *one;
int (*f) ();
printf ("Loading: %s: ", argv [1]);
one = dlopen (argv [1], RTLD_NOW);
if (!one)
{
printf ("Failed: %s\n", dlerror());
return 1;
}
printf ("OK\n");
I got
# ./main plugin/foo.so
Loading: plugin/foo.so: Failed: : shared object not open
Under gdb
GNU gdb 5.2-0.5 (5.2.0_2002-05-23-cvs)
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux"...
Setting up the environment for debugging gdb.
.gdbinit:5: Error in sourced command file:
Function "internal_error" not defined.
(gdb) r plugin/foo.so
Starting program: /home/hjl/bugs/libc/dlopen6/main plugin/foo.so
Error while reading shared library symbols:
Cannot find new threads: generic error
Cannot find user-level thread for LWP 4922: generic error
(gdb)
If I changed it to
one = dlopen (argv [1], RTLD_LAZY);
I got
# ./main plugin/foo.so
Loading: plugin/foo.so: Failed: lib/libbucky.so.1: undefined symbol: fooooooo
(gdb) r plugin/foo.so
Starting program: /home/hjl/bugs/libc/dlopen6/main plugin/foo.so
[New Thread 1024 (LWP 5024)]
Loading: plugin/foo.so: Failed: lib/libbucky.so.1: undefined symbol: fooooooo
I only did a dlopen. Why does RTLD_NOW make a difference for gdb?
H.J.