This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/34152] Erratic behaviour: Exception translation (throw from signal handlers)
- From: "asteinarson at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Nov 2007 16:21:28 -0000
- Subject: [Bug c++/34152] Erratic behaviour: Exception translation (throw from signal handlers)
- References: <bug-34152-15034@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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