Access Vialotation

Christopher Wright dhasenan at gmail.com
Sat Feb 28 05:47:16 PST 2009


downs wrote:
> BCS wrote:
>> Reply to Jarrett,
>>
>>> On Fri, Feb 27, 2009 at 9:01 AM, Qian Xu <quian.xu at stud.tu-ilmenau.de>
>>> wrote:
>>>
>>>> Hi All,
>>>>
>>>> Is there any way to keep program alive, when an AV takes place?
>>>>
>>> It's possible on Windows in D, but that's because Windows reports
>>> segfaults with the same mechanism that D uses for exceptions.  Since
>>> Linux (and many other Posix systems) uses signals, it's probably very
>>> tricky to implement in a cross-platform manner.
>>>
>> you can have a posix signal handler throw an exception (I have done it
>> and had it work) but I have no idea if it is supported.
>>
>>
> In my experience, that works exactly once.

So you can use the signal handler to print a stack trace and maybe some 
context, but throwing an exception that you then catch is dangerous.


More information about the Digitalmars-d-learn mailing list