This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
_Unwind_RaiseException incompatibility?
- From: Stephan Bergmann <stephan dot bergmann at sun dot com>
- To: gcc at gcc dot gnu dot org
- Date: Tue, 02 Sep 2003 10:29:09 +0200
- Subject: _Unwind_RaiseException incompatibility?
Hi all.
I have a GCC-3.2--built executable that loads shared libraries and
executes code in them. I now experience problems when some of those
shared libraries are compiled with GCC 3.3 instead of 3.2; C++ exception
handling within those libraries leads to std::terminate and abort. The
stdc++ and gcc_s libraries used by the process are those from GCC 3.2.
I tracked down one cause for an abort as follows: A GCC-3.3--built
shared library wants to throw a C++ exception, calls __cxa_throw (stdc++
library), which in turn calls _Unwind_RaiseException (gcc_s library).
For some reason, _Unwind_RaiseException (erroneously) returns normally,
so that __cxa_throw continues with a call to std::terminate. If I only
replace the used gcc_s library (from GCC 3.2) with the one from GCC 3.3,
everything appears to work fine (I tested various scenarios where a C++
exception is thrown in one library and caught in the same/another/the
executable).
My question now: Is this a known issue? Does anybody know whether my
problem (GCC-3.2--built executable executing shared libraries built with
both GCC 3.2 and 3.3) is solved reliably if I always use the gcc_s
library from GCC 3.3---that is, will _all_ scenarios with
inter-/intra-library exceptions work?
Thanks,
Stephan