[C++-sig] Re: more cross-module problems

David Abrahams dave at boost-consulting.com
Thu Jul 24 16:16:15 CEST 2003


greg Landrum <greglandrum at mindspring.com> writes:

> Dave's patch cleared up the exception problems I reported yesterday,
> but I've got more cross-module problems to report.
>
> The attached zip file will create a directory called RDTest.  If you
> extract it in $Boost/libs/python, you'll end up with something that
> can be built with bjam.  I apologize in advance for the names of
> things here...
>
> The Jamfile runs two tests, both of which use multiple modules and
> explore passing objects between them.  One of the tests works on
> Windows and fails on Linux, the other works on Linux and fails on
> Windows.
>
> The first test (named both_mods in the Jamfile) explores what happens
> if classes with boost::any data members are passed between modules.
> This test works fine on Windows but fails on Linux with the error:
>            RuntimeError: boost::bad_any_cast: failed conversion using
>            boost::any_cast
>
> The second test (named CM2_test) creates three modules (modulea,
> moduleb and modulec).  modulea and modulec define simple classes
> (classA and classC) that use STL containers to map std::strings ->
> integers.  classA does this with an std::map and classC does it with
> an std::vector of std::pairs.  As the test demonstrates, both these
> modules work ok by themselves.  moduleb has 2 functions: testCrossA()
> takes a classA instance and gets a property from it; testCrossC()
> takes a classC instance and gets a property.  moduleb works without
> problems on Linux, but the test using classA instances (which carry
> around std::maps) fails on Windows with the dread:
>            RuntimeError: unidentifiable C++ exception
> error.
>
> Platform notes;
> Windows = [Win2K, MSVC v6, python 2.2, boost 1.30.0]
> Linux = [RH8.0, g++ 3.2, python 2.2, boost 1.30.0]

OK, Greg:

None of these problems with boost::any have anything to do with
Boost.Python per-se.  I'll try to explain what's going on if you'll
agree to write a FAQ entry or other documentation page for
Boost.Python which describes the cross-module issues in detail.  Deal?

The Windows crash, FWIW, is a poor-QOI issue "bug" in the Dinkumware
standard library that ships with vc6.  vc7 solves it:

*****************************
Testing self print for classA
*****************************

*****************************
Testing self print for classC
*****************************

*****************************
Testing crossing C to B
*****************************

*****************************
Testing crossing A to B
*****************************
has useless
has useless
has useless
has useless


-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com





More information about the Cplusplus-sig mailing list