[uClibc] Re: arm-nommu struct sigaction

Gregory Nutt spudmonkey at racsa.co.cr
Wed Aug 27 23:06:10 UTC 2003


Once again,

It looks uClibc's 'struct sigaction' matches the kernels old_sigaction.

However, uClibc's signal() calls uClibc's sigaction() to perform the 
system call.  For the arm platform, uClibc's sigaction then converts the 
uClibc struct sigaction (aka kernel old_sigaction to):

struct kernel_sigaction {
     __sighandler_t k_sa_handler;
     unsigned long sa_flags;
     void (*sa_restorer) (void);
     sigset_t sa_mask;
};

Which matches the kernel's struct sigaction.  BUT, the ARM kernel's 
sys_sigaction handler assumes struct old_sigaction which doesn't match 
what it gets from uClibc.  (I am so confused).

So, the fix is... ???? I think uClibc-0.9.20/libc/signals/sigaction.c 
should use a kernel_sigaction that matches old_sigaction.

Thoughts?

Greg Nutt

Gregory Nutt wrote:
> Hello, again,
> 
> I sent this too soon! (I've been working too hard today).
> 
> The trap handlers actually use old_sigaction which does match the 
> structure used by uClibc.
> 
> Greg
> 
> Gregory Nutt wrote:
> 
>> Hello, list(s),
>>
>> I have a question regarding the definition of 'struct sigaction.' In 
>> uClibc-0.9.20/include/bits/sigaction.h the definitions is (comments 
>> and unions eliminated for simplicity):
>>
>> struct sigaction
>>   {
>>    __sighandler_t sa_handler;
>>    __sigset_t sa_mask;
>>    int sa_flags;
>>    void (*sa_restorer) (void);
>> };
>>
>> This struct definition has been in uClibc since (at least) 0.9.15.
>>
>> I am using uClinux with ARM7 (2.4.19-uc1).  The definition of 
>> sigaction that I find in linux/asm-armnommu/signal.h is as follows.  
>> This structure is the same in the current CVS arm-nommu version 1.2 as 
>> well and it is for asm-m68knommu in my version).
>>
>> struct sigaction {
>>    __sighandler_t sa_handler;
>>    unsigned long sa_flags;
>>    void (*sa_restorer)(void);
>>    sigset_t sa_mask;
>> };
>>
>> The symptom that I see is that, depending upon how uclib sets sa_mask, 
>> uClinux may think that SA_RESTORER is selected in sa_flags and opt to 
>> use an invalid sa_restorer and the system crashes upon return from a 
>> signal.
>>
>> According to 'man sigaction' uClibc is using a more closely correct 
>> definition and asm-armnommu/signal.h should be changed to match uClibc.
>>
>> Does that sound right? Comments anyone?
>>
>> Gregory Nutt
>>
>>
> 
> 





More information about the uClibc mailing list