dereferencing null

deadalnix deadalnix at gmail.com
Mon Mar 5 10:29:09 PST 2012


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.


More information about the Digitalmars-d mailing list