[Bug c++/34152] Erratic behaviour: Exception translation (throw from signal handlers)
asteinarson at gmail dot com
gcc-bugzilla@gcc.gnu.org
Mon Nov 19 16:21:00 GMT 2007
------- Comment #1 from asteinarson at gmail dot com 2007-11-19 16:21 -------
I found something out. If I add a further function call to FuncNested1:
int FuncNested2( ){
StructWithDtor swd;
return 0;
}
int FuncNested1( int *pi ){
StructWithDtor swd;
FuncNested2( ); // This trigger unwind table generation
return *pi;
}
then it works. It seems that FuncNested1 in the first form:
int FuncNested1( int *pi ){
StructWithDtor swd;
return *pi;
}
never generates any unwinding information (since it doesn't call other
functions) and when SIGSEGV happens inside it, it cannot find any unwind tables
and C++ run-time bails out. I can understand the logic behind this, but it
certainly made my first test case fail miserably.
In a realworld app, the optimization is probably OK, since a function
generating the signal is likely to contain other function calls (not bullet
proof).
It is possible to interpret -asynchronous-unwind-tables to support this but
that option changes nothing for my test case.
An option -always-generate-unwind-tables would be useful in this case (but
probably results in a larger executable).
Regards
// ATS.
--
asteinarson at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |asteinarson at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34152
More information about the Gcc-bugs
mailing list