http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50678
--- Comment #30 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2011-10-15 20:49:03 UTC --- > however I've not got far through Raise_From_Signal_Handler () - if one > continues from there it ends with a loop on x86-64/darwin9 and another segv on > x86-64/darwin10. You need to compile with -fstack-check. Then you'll be able to debug the unwinding phase. Here are some possible breakpoints: 0x00007fff85b7a260 in unw_init_local () from /usr/lib/libSystem.B.dylib (gdb) disass Dump of assembler code for function unw_init_local: Breakpoint 3, 0x00007fff85b9fe32 in unwind_phase2 () from /usr/lib/libSystem.B.dylib (gdb) disass Dump of assembler code for function unwind_phase2: 0x00007fff85ba0150 in libunwind::Registers_x86_64::jumpto() () from /usr/lib/libSystem.B.dylib (gdb) disass Dump of assembler code for function _ZN9libunwind16Registers_x86_646jumptoEv: => 0x00007fff85ba0150 <+0>: mov 0x38(%rdi),%rax The context from which jumpto restores the registers has the wrong %rbx line. > The thing that's itching slightly is that there is a syscall (in > __gnat_error_handler ) to switch the signal stack - before the raise, and I > wonder if the use of the alt sigstack is what's causing the problem. This call doesn't actually do anything. The stack is switched by the system before __gnat_error_handler is entered and all the processing is done using the alternate stack, until execution is resumed in the exception handler. > One would imagine that anything as radical as a missing reg. save/rest in eh > would be spotted outside Ada ;-) Java is the only other language that supports this kind of things though.