trying setjmp or throwing from signal handler crashes on OSX

Jacob Carlborg doob at me.com
Sun Sep 2 02:26:50 PDT 2012


On 2012-09-02 02:37, timotheecour wrote:
> Is there any way to get setjmp to work in a D program on OSX?
> I just get a segfault whenever it is called.
>
> I'm just trying to recover from a signal handler.
>
> Related questions:
> why is signal handler nothrow?
>
> I saw this related thread but it seems linux only:
> http://www.deadalnix.me/2012/03/24/get-an-exception-from-a-segfault-on-linux-x86-and-x86_64-using-some-black-magic/
>
> with code:
> http://www.deadalnix.me/wp-content/uploads/2012/03/sigsegv.d.txt

Since this is kind of low level I would guess you cannot just take a 
Linux guide and have it work on Mac OS X. Both are Posix but at this low 
level the differences between the platforms start to show up.

BTW, I get "Error: undefined identifier ucontext_t" when compiling that 
file on Mac OS X.

-- 
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list