[C++-sig] slots != 0

David Abrahams dave at boost-consulting.com
Tue Jul 19 05:06:05 CEST 2005


Aaron Bentley <abentley at panoramicfeedback.com> writes:

> Hi all,
>
> I seem to have encountered a condition that should be impossible, in
> Boost 1.31 Python.
>
> I was getting assertion failures on registry.cpp, line 162:
>
>       assert(slot == 0); // we have a problem otherwise
>
> Commenting it out, I got a big stack of warnings about various things in
> my _xml module being imported twice.  

I'm pretty sure that's not what the warnings said.  Probably something
more like


  "to-Python converter for xxx already registered; second conversion method ignored."

> I can't see how this could happen, and I don't know whether this is
> my bug or boost's.  Any suggestion of the type of thing that could
> cause this would be appreciated.

Exposing the same type to Python twice (usually from two separate
extension modules linked to the same libboost_python) will do it.

> So far, it's defying attempts to produce a reasonable test case.  There
> may be circular dependencies, or something wacky like that.
>
> Aaron
>
> $ ppython pflib/report_gen.py
> /home/abentley/programming/python/pflib/pfxml.py:3: RuntimeWarning:
> to-Python converter for 7xmlList already registered; second conversion
> method ignored.
>   import _xml
> /home/abentley/programming/python/pflib/pfxml.py:3: RuntimeWarning:
> to-Python converter for N3xml8XmlTableE already registered; second
> conversion method ignored.
>   import _xml
> /home/abentley/programming/python/pflib/pfxml.py:3: RuntimeWarning:
> to-Python converter for St8auto_ptrIN3xml8XmlTableEE already registered;
> second conversion method ignored.
>   import _xml

I suggest you recompile registry.cpp with BOOST_PYTHON_TRACE_REGISTRY
defined and look at the output to see where xmlList is exposed to
python the first and second times.

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




More information about the Cplusplus-sig mailing list