Re: Silly 100% CPU behavior on a SIG_IGN-ored SIGBUS.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 23, 2009 at 03:44:29PM -0700, Kevin D. Kissell wrote:

>> int main(void)
>> {
>>   int *deadbeef = (int *) 0xdeadbeef;
>>   signal(SIGBUS, SIG_IGN);
>>   printf("*deadbeef == %d\n", *deadbeef);
>>   return 0;
>> }
>>
>> If any fatal exception is ignored, the program should be killed
>> if that exception happens. 100% CPU is not a useful response.
>>   
> It's not a useful program, so what did you expect?   One might argue  
> that it would be more useful or correct to have the kernel advance the  
> PC to not endlessly repeat the doomed load, but ignoring SIG_IGN and  
> silently killing the thread violates the signal API as I've always  
> understood it.

It's not a useful program but valid as a test case.  However I agree with
your interpretation of signal semantics but I'll have to round up a copy
of the relevant standard documents; I have vague memories about some small
print for cases like this.

  Ralf


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux