NotNull pointers
Steven Schveighoffer
schveiguy at yahoo.com
Wed Aug 31 14:01:33 PDT 2011
On Wed, 31 Aug 2011 16:40:02 -0400, Robert Clipsham
<robert at octarineparrot.com> wrote:
> On 31/08/2011 21:19, Steven Schveighoffer wrote:
>>> It's also possible for the program to have its own seg fault handler
>>> that reads its own symbolic debug info and generates a line number and
>>> stack trace. There was a patch to Phobos that did this a while back.
>>
>> This would also be a valid option. I have no idea why that wasn't
>> included. Do you?
>
> It's not easy to catch SIGSEGV on linux, there's a library that'll do it
> but it's GPL (iirc), an equivalent would need writing from scratch if it
> were to be included in druntime/phobos.
You can catch sigsegv on linux. It takes one call to signal to register a
handler.
The difficult part is unwinding the stack. You can't throw an exception
from a signal handler (or reliably do it anyways).
Also, the stack may be in some other language (e.g. C).
But I do remember the patch and discussion, I thought all these problems
were solved, no? Why wasn't this adopted?
-Steve
More information about the Digitalmars-d
mailing list