[C++-sig] crash with gcc 3.0.4

Robert Andre randre at pppl.gov
Fri Apr 26 19:14:14 CEST 2002


>>   1) exceptions sometimes loose their type information so error
>>      messages are lost (weird).
>
>It's a long-standing issue with Boost.Python that there is no
>generalized mechanism for C++ -> Python exception translation. The only
>way to be sure that /some/ information will be preserved is to derive
>C++ exceptions from std::exception, and to make sure the what() string
>gives you some useful information. I plan to address this problem for
>Boost.Python v2 in Q3 of this year.

The weird part is that I do derive from std::exception but the information
that it is derived from std::exception is somehow lost while unwrapping 
the call stack.  This only happens with cross modules and only for some
of the exceptions.

>Shot in the dark: if you are having trouble with exceptions thrown
>across shared library boundaries, it might help if the shared libs were
>explicitly linked to one another.

That's an idea though slightly contrary to the purpose of cross modules.

>?? What's the difference between a shared and a dynamic library ??

on linux (or elf systems) none as far as I know, on mac osx the shared
libraries are different then the dynamically loadable kind which are
called bundles -- not sure about other systems.

>The Boost.Python v1 cross-module support is somewhat ad-hoc, and
>development is proceeding full-speed on Boost.Python v2. Rather than
>trying to address this kind of problem in the v1 sources, I plan to
>release v2 as a replacement for v1.

ok, my guess is that the segfault problem I am having has to do with
either how I am building the libraries or more likely a bug in gcc
stringstream or the fact that I am compiling with gcc3 on systems
setup for gcc2.  I've seen it crash in instringstream also so it's
not a boost thing.  I'm just surprised nobody else has encountered it.

We haven't really decided whether to go the boost.python, jython, swig or
some other route yet but in case we do use boost it would be helpful
if you could keep the strstream option available in v2,v3... so that
we can support gcc 3.0 users.

thanks dave,

rob






More information about the Cplusplus-sig mailing list