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

Wirawan Purwanto wirawan0 at softhome.net
Fri Jul 2 01:20:11 CEST 2004

> 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.


>> I don't believe that my code was the one doing the mess. I
>> tend to think that somehow the compiled boost_python code was acting
>> up here.
> Always blame the other guy ;-)

Well, sorry if this offended you. :) I didn't mean to belittle your 
program in any way. May be there's a bad interaction between
libboost_python.so and my code, probably?

>> 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?

Nothing, of course. ;) But remember that I use a precompiled python from 
Mandrake. There is no debug code available, IIRC. I couldn't do 
single-step within the python itself. But this is not an issue. What I 
wanted to do is to put some breakpoints in both my code and 
libboost_python.so. Now, how do I set the breakpoint on such dynamic 
libraries? The symbol may not have been loaded by that time, and I've 
never debugged in this way before.

>> Using python debugger is also not possible, since I don't think it
>> allows going down to the C++-level code.
>> As a workaround, I could only link my HubbardGP.so against the DEBUG
>> variant (libboost_python-gcc-d.so). Then the code went fine, even with
>> .add_property() there.
> Sounds like you got your build commands wrong.  Never fails.  Use bjam
> first, then once you get that right, you can do whatever you want.

I'm not sure if the build is the one to blame. In fact, I did what you 
suggested (i.e. to run bjam by showing the actual command-line executed), 
and copied them to my makefile. I will try to get a Jamfile written for my 
code. Once done, I'll get back to you.


More information about the Cplusplus-sig mailing list