This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


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

Segfault in pthread.c



Compiling glibc 2.1.x CVS with gcc 2.95.2 gives a segfault in
Program received signal SIGSEGV, Segmentation fault.
0x4001d21c in pthread_initialize () at pthread.c:375
375       if (__dso_handle)
(gdb) p __dso_handle
No symbol "__dso_handle" in current context.

This was introduced by the following change:
2000-03-19  Ulrich Drepper  <drepper@redhat.com>

	* pthread.c (pthread_initialize): Instead of on_exit use
	__cxa_atexit if __dso_label is available to allow unloading the
	libpthread shared library.

I'm appending a patch to get this working with gcc 2.95.2 - the patch
is needed for both branches.

Btw. Uli, you changed __on_exit to on_exit - is this ok?

Andreas

2000-03-21  Andreas Jaeger  <aj@suse.de>

	* pthread.c (pthread_initialize): Proper check for existence of
	__dso_handle.

============================================================
Index: linuxthreads/pthread.c
--- linuxthreads/pthread.c	2000/03/20 07:06:15	1.35
+++ linuxthreads/pthread.c	2000/03/21 08:13:52
@@ -389,7 +389,7 @@
   /* Register an exit function to kill all other threads. */
   /* Do it early so that user-registered atexit functions are called
      before pthread_exit_process. */
-  if (__dso_handle)
+  if (&__dso_handle != NULL)
     /* The cast is a bit unclean.  The function expects two arguments but
        we can only pass one.  Fortunately this is not a problem since the
        second argument of `pthread_exit_process' is simply ignored.  */

-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.rhein-neckar.de

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