[C++-sig] Re: Problem: boost_python 1.31 (release) causes huge memory allocation

Wirawan Purwanto wirawan0 at softhome.net
Tue Jul 6 19:15:59 CEST 2004


Hi,

Well, the issue has been resolved. The bug turns out to be on my side 
(i.e. in my own code), in the construction stage of the object. That was a 
very subtle bug, which (believe it or not) wasn't exposed until I tried to 
play with boost::python. Anyway, thanks for the help.

>> To get the right compilation/link command lines, build the example
>> projects using bjam -d+2 or just trial-run the build with bjam -n -a
>> and copy those down.  I can't vouch for your bulid being correct otherwise.
>>
>>> QUESTION: Without the .addproperty() stuff (that's commented in the
>>> snippet above), the code runs fine. But when I added the
>>> .addproperty() line, a calamity happens: when I was about to
>>> instantiate HubbardGP object, the computer froze.


>>> But I can't debug the code easily, as it involves running
>>> python itself in the debugger. How do you debug such a problem?
>>
>> I run Python itself in the debugger.  What's so hard about that?

Resolved. I saw again that there was some info in the FAQ.
I have taken another approach, i.e. by embedding the python interpreter 
plus boost::python interface into my code.


[from Greg Landrum]:

> If you run gdb on python itself, you can try setting the breakpoint
> right away, newer versions of gdb will give you a message like this:
> Make breakpoint pending on future shared library load? (y or [n])
> just reply 'y' and everything should work ok.
>
> If you have an older version of gdb,  wait until after your .so has
> been loaded (after you do an import) and then set the breakpoint.

Which version is the GDB that you mean? I'm currently using either GDB 
5.2, 5.3 or 6.0.


Wirawan



More information about the Cplusplus-sig mailing list