A working backtrace for linux

Sean Kelly sean at invisibleduck.org
Wed Aug 4 07:31:15 PDT 2010


Johannes Pfau <spam at example.com> wrote:
> On 04.08.2010 07:26, David Bryant wrote:
>> Ok,
>> 
>> I've added -L--export-dynamic to dmd.conf and done a copy/modify of
>> DefaultTraceInfo from runtime.d to include demangling and catch
> > certain
>> signals. My backtraces now look gorgeous under Linux.
>> 
>> I've attached the source for the updated module.
>> 
>> Thanks,
>> Dave
>> 
> 
> Nice work, but one question regarding signal handling:
> You throw an Error directly in the signal handler, isn't
> this quite dangerous? See for example
> http://en.wikipedia.org/wiki/Signal_(computing)#Risks
> (That's all theory though: in practice signal handling implementations
> are usually more robust.)
> 

This actually came up during Andrei's talk at Google. Throwing
exceptions from signal handlers is illegal insofar as Posix docs are
concerned, so this feature won't be in druntime. It does actually work
on some platforms though, so it's a good thing to test and add if you
want this feature.


More information about the Digitalmars-d mailing list