help-gplusplus
[Top][All Lists]
Advanced

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

Re: exceptions are not caught


From: Paul Pluzhnikov
Subject: Re: exceptions are not caught
Date: Tue, 12 Feb 2008 08:40:53 -0800
User-agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, linux)

Krishanu Debnath <krishanu@magma-da.com> writes:

> This is a platform specific problem, platform is RHEL4.
> We use boost::serialization code, and linked with their static library.
> And the problem we are facing that all of our exception handler codes
> are not working any more i.e. catch handler is not called if an
> exception is thrown. We are not even calling the boost::serializer
> code.
> If we remove serializer code everything works fine.
>
> Serializer code works pretty fine in suse platform.

The problem likely comes from linking together code which is not
link-compatible [1].

Did you recompile libboost on the RHEL4 box, or did you simply copy
the library from the SuSE box onto RHEL4 box?

If the latter, are both machines using the same version of gcc?

> Now my question is how come exception handler codes are not executing
> just because we are linking with some library(even if the library
> code lets say ill-form/invokes UB, we are not calling any function
> from the library anyway).

The code from libboost likely overrides some exception-handling
symbols in libstdc++.so.N with incorrect versions, so merely linking
against the library is all that's needed to gum up the works.

Cheers,

[1] Symbol versioning often prevents such mistakes, but it only
works when you use shared libraries; not archive ones. Did you
switch to archive libboost because your link failed when using
shared versions? If so, you have only yourself to blame :(
-- 
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]