digitalmars.D.learn - trying setjmp or throwing from signal handler crashes on OSX
- timotheecour (9/9) Sep 01 2012 Is there any way to get setjmp to work in a D program on OSX?
- Jacob Carlborg (8/17) Sep 02 2012 Since this is kind of low level I would guess you cannot just take a
- timotheecour (4/10) Sep 02 2012 I got that too. So I also tried linking my D program against a C
- Jacob Carlborg (4/8) Sep 02 2012 I have no idea.
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
Sep 01 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.txtSince 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
Sep 02 2012
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.I got that too. So I also tried linking my D program against a C library that would call those set jmp and long jmp functions, but that crashed too. So I guess there's currently no clean way to recover from signals on OSX ?
Sep 02 2012
On 2012-09-03 00:05, timotheecour wrote:I got that too. So I also tried linking my D program against a C library that would call those set jmp and long jmp functions, but that crashed too. So I guess there's currently no clean way to recover from signals on OSX ?I have no idea. -- /Jacob Carlborg
Sep 02 2012