Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


On 08/09/2012 17:52, Norbert Thiebaud wrote:
On Fri, Sep 7, 2012 at 5:49 PM, julien2412<serval2412@yahoo.fr>  wrote:
on this page http://wiki.documentfoundation.org/Development/How_to_debug
but what about if custom memory allocator is bugged? (BTW why do we use
this? Historical reason?) Wouldn't Valgrind be helpful to detect it?

I'm a bit lost here :-(
Julien,

A custom allocator will necessarily confuse valgrind...  the only way
to 'unconfuse' it would be to teach valgrind about it and have
valgrind emulate the allocation mechanism of the custom allocator to
keep track of what is 'logically' allocated/freed... doing that would
be quite complex and the odd of doing a bug in the emulation layer is
much higher than the odd that there is a bug in the custom allocator
to start with...

So, in general, when using valgrind you _do_ want to disable any
'custom allocator'. and yes that won't help you find a bug in the
allocator... but if you have a bug, think horse not zebra... 99.999%
of the time your bug will have nothing to do with the allocator
itself.

Norbert
Thank you Norbert for your answer, it's clearer for me now. (moreover I didn't know this expression, "think horse not zebra" :-)) So in http://wiki.documentfoundation.org/BugReport#How_to_get_valgrind_log_.28on_Linux.29 page, should I add this:

export G_SLICE=always-malloc

before this:

valgrind --tool=memcheck --num-callers=50 --trace-children=yes ./soffice.bin 2>&1 | tee 
/tmp/valgrind.log

?

Julien

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.