>> I am trying to use signals and it is segfaulting in the linuxthreads code. I 
>> have not 
>> delved into it deeply yet but I think that self in __pthread_sighandler_rt() 
>> is NULL. I am 
>> guessing this is because I have setup a separate signal stack using 
>> sigaltstack and so the 
>> thread_self() function is unable to determine the thread.
>>

snip

> 
> arm and linuxthread is not well tested in uclibc. 
> So I suggest try linuxtthreads.old or the nptl-branch.

I tried linuxthreads.old first and hit a similar problem so moved to 
linuxthreads hoping 
there might be a fix.

Looking at the code it seems like signal handling with a separate signal stack 
specified 
with sigaltstack is broken.

The problem is that __pthread_sighandler_rt() is being called with the signal 
stack but it 
calls check_thread_self() which in turn calls thread_self() which determines 
which thread 
it is in by referring to the stack pointer. This does not work because the 
stack pointer 
points to the signal stack. Think instead __pthread_sighandler_rt() needs to 
use ucontext 
to get the stack pointer before the exception and then that needs to be used to 
to get the 
pthread_descr pointer.

Can someone with more experience of the thread code comment? Does that sound 
right? The 
problem is that getting the stack pointer from the ucontext struct is platform 
specific I 
believe.

Guess I'll try hacking something together for arm to begin with and see if my 
theory is right.

Will.

-- 
------------------------------------------------------------------------
Will Wagner                                     will_wag...@carallon.com
Development Manager                      Office Tel: +44 (0)20 7371 2032
Carallon Ltd, Studio G20, Shepherds Building, Rockley Rd, London W14 0DA
------------------------------------------------------------------------


_______________________________________________
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc

Reply via email to