un-catched segfault exception

Sean Kelly sean at f4.ca
Fri Jan 11 08:21:11 PST 2008


Robert Fraser wrote:
> Sean Kelly wrote:
>> philippe.quesnel wrote:
>>> Jarrett Billingsley Wrote:
>>>
>>>> That's funny, cause on DMDWin you _can_ catch them.
>>>>
>>>
>>> I just did a test C++ app in Windows (MsDev) .. and I do catch 
>>> exceptions thrown by a null ptr reference.
>>> Which is what I was expecting to happen in D.
>>
>> Segfaults in Windows pass through the Structured Exception Handling 
>> mechanism, as do many other hardware-level errors.  It's the Windows 
>> response to signals in Unix.  And DMD is nice enough to turn these 
>> into D exceptions for you.  It sounds like GDC does its exception 
>> handling another way however, and does not.
> 
> Any way to get Flectioned tracing them?

Generating a stack trace within a signal handler would probably work, 
though it isn't guaranteed to.  I'd say it depends on how the OS handles 
hardware signals.  Throwing exceptions from signal handlers has the same 
problem.


Sean



More information about the Digitalmars-d mailing list