[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: linuxthreads 2.2.2 causes SEGV
From: |
Dan Maas |
Subject: |
Re: linuxthreads 2.2.2 causes SEGV |
Date: |
Thu, 22 Mar 2001 05:37:26 -0500 |
> > I just recompiled glibc-2.2.2 by putting back the pieces of code
> > which were removed (as indicated by Dan). I can now compile
> > and run programs that use libpthread, BUT only if I statically
> > link with the threads library. If I compile to use the dynamic
> > libpthread, I continue to get the SEGV in __pthread_alt_lock().
After further investigation I have concluded that LDT-based pthreads is
simply broken; either GCC's __register_frame_info() or glibc's
__libc_global_ctors() must be changed for it to work.
For those of you who just want a functional pthreads library, I have a
guaranteed fix: go to the bottom of
glibc-2.2.2/linuxthreads/sysdeps/i386/i686/pt-machine.h. Take the line that
says
#if __ASSUME_LDT_WORKS > 0
and change it to
#if 0
Then recompile and reinstall glibc. Pthreads will work again.
(this change simply disables the use of LDT for thread-specific data;
pthreads will fall back to its default implementation, which is slightly
slower but does not require any initialization).
Regards,
Dan