dereferencing null

Steven Schveighoffer schveiguy at yahoo.com
Mon Mar 5 13:12:46 PST 2012


On Mon, 05 Mar 2012 13:29:09 -0500, deadalnix <deadalnix at gmail.com> wrote:

> Le 05/03/2012 15:26, Steven Schveighoffer a écrit :
>> On Fri, 02 Mar 2012 10:19:13 -0500, deadalnix <deadalnix at gmail.com>  
>> wrote:
>>
>>> Le 02/03/2012 15:37, Jacob Carlborg a écrit :
>>>> Isn't it quite unsafe to throw an exception in a signal ?
>>
>> One does not need to throw an exception. Just print a stack trace. I've
>> advocated for this multiple times. I agree it costs nothing to
>> implement, and who cares about safety when the app is about to crash?!
>>
>>> The signal handler is called on top of the stack, but the information
>>> to retrieve the stack trace are system dependant. BTW, using lib like
>>> libsigsegv can help a lot to make it safe. It isn't safe ATM, but it
>>> is doable.
>>
>> libsigsegv is used to perform custom handling of page faults (e.g.
>> loading pages of memory from a database instead of the MMC). You do not
>> need libsigsegv to handle SEGV signals.
>>
>> -Steve
>
> No you don't, but if you want to know if you are facing a stackoverflow  
> or a null deference for exemple, this greatly help the implementation.

It's somewhat off the table with it's GPL license.  But even so, I don't  
see that it helps here, we are not looking to continue execution, just  
more information on the crash than "Segmentation Fault".

-Steve


More information about the Digitalmars-d mailing list