This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: _Unwind_RaiseException incompatibility?


Stephan Bergmann <stephan.bergmann@sun.com> writes:

> 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

You need libstdc++ and libgcc_s from 3.3 if you run libraries compiled
with 3.3.

> 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?

It should work in all cases.  If not, it's a bug.  But the other way
round - as you tried - is expected to fail and not supported,

Andreas
-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SuSE Linux AG, Deutschherrnstr. 15-19, 90429 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126

Attachment: pgp00000.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]