This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc 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]

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.


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