Signal handlers and _Unwind_IsSignalFrame

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I have a problem. I want to handle signals like SIGSEGV in non-main
threads of C++ program and terminate thread by pthread_exit call. Of
course I need all destructors of objects on stack to be called (eg.
mutex unlocking).

When compiling with -fnon-call-exceptios everything almost works but:

In context is saved address of failing instruction, not adress of
instruction after the failing one. Thus decrementing of this address in
__gxx_personality_v0 sometimes leads to calling of terminate(), because
no suitable entry in call-site table (?is it the right name?) is found
in .gcc_except_table. 

It is clearly supposed to be handled by SIGNAL_FRAME_BIT in flagss in
struct _Unwind_Context. But this bit is not set in my context. That is
why __gxx_personality misses proper handler by one byte, and calls
terminate instead. If I put one simple pointer dereference before my
failing instruction, decremented address is now inside the range
described in call-site table and everything works fine.

I am not sure I understand well how the SIGNAL_FRAME_BIT flag is
supposed to be set. Shall there be a CIE with "S" augmentation
in .eh_frame for signal handler? Threre is not such one in my program.
How can I make gcc to create one? Or am I completely wrong?

Just for completenes I have tried with gcc 4.1.0 and 4.2.1 on x86_64
(Suse 10.1 and 10.3).

Thanks in advance




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux