[Kde-bindings] Memleak in Korundum?

Richard Dale Richard_Dale at tipitina.demon.co.uk
Mon Aug 28 18:17:16 UTC 2006


On Monday 28 August 2006 18:23, Caleb Tennis wrote:
> > Without a tool like MallocDebug it's very hard to fix this sort of thing,
> > and
> > I don't know of anything similar for Linux - is there one of the valgrind
> > related tools for doing this?
>
> Richard,
>
> I've found that this happens extremely fast when using dcop signals/slots.
>  I have a simple KApplication that has a dcop slot, and I invoke it from
> an external program with a DCOP signal.  I see no memory consumption if
> the slot has 0 arguments, but as soon as I'm marshalling data, it seems
> that memory consumption grows very fast.  Below is the the valgrind look
> at the code that is being consumed.  The number of bytes "lost" continues
> to grow the longer the program runs (as opposed to all of the other
> warnings valgrind throws which seem to be the same amount no matter how
> long the program runs):
>
>
> ==13625==
> ==13625== 14,580 bytes in 215 blocks are definitely lost in loss record
> 182 of 201
> ==13625==    at 0x4020849: operator new[](unsigned) (in
> /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
> ==13625==    by 0x43AB278: construct_copy(smokeruby_object*)
> (handlers.cpp:419)
I suspected that excessive calls of 'construct_copy()' were causing the Qt4 
memory leak, and was going to put some diagnostics in to confirm. So this 
looks the most likely suspect for the DCOP leak to me. The other possibility 
would be leaks in the QCString marshalling. Maybe the next thing to do is to 
narrow down which arg types cause the memory leak.

> ==13625==    by 0x43AC021: marshall_basetype(Marshall*) (handlers.cpp:711)
> ==13625==    by 0x43A6D88: VirtualMethodCall::next() (Qt.cpp:306)
> ==13625==    by 0x43A9190: marshall_QCString(Marshall*) (handlers.cpp:975)
> ==13625==    by 0x43A6D88: VirtualMethodCall::next() (Qt.cpp:306)
> ==13625==    by 0x43A81F4: QtRubySmokeBinding::callMethod(short, void*,
> Smoke::StackItem*, bool) (Qt.cpp:814)
> ==13625==    by 0x4C5308A: x_DCOPObject::process(QCString const&,
> QMemArray<char> const&, QCString&, QMemArray<char>&) (x_1.cpp
>
> :794)
>
> ==13625==    by 0x62F22EA: DCOPClient::receive(QCString const&, QCString
> const&, QCString const&, QMemArray<char> const&, QCStr
> ing&, QMemArray<char>&) (in /usr/kde/3.5/lib/libDCOP.so.4.2.0)
> ==13625==    by 0x62F65BA: (within /usr/kde/3.5/lib/libDCOP.so.4.2.0)
> ==13625==    by 0x62F6CD2: (within /usr/kde/3.5/lib/libDCOP.so.4.2.0)
> ==13625==    by 0x630183E: KDE_IceProcessMessages (in
> /usr/kde/3.5/lib/libDCOP.so.4.2.0)
> ==13625==

-- Richard



More information about the Kde-bindings mailing list