dereferencing null

Steven Schveighoffer schveiguy at yahoo.com
Mon Mar 5 06:26:58 PST 2012


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


More information about the Digitalmars-d mailing list