[Xapian-discuss] Debug build

Olly Betts olly at survex.com
Wed Mar 17 03:51:21 GMT 2010


On Tue, Mar 16, 2010 at 06:26:08PM +0100, double wrote:
> I have updated to Xapian 1.1.4 and maybe there is a memory leak.

It's not impossible, but we do run the testsuite under valgrind, so the
memory leak would need to have a dangling reference, or not be exercised
by the testsuite.

> I can run only dmalloc - valgrind would be much too slow.

Personally I've found valgrind is fast enough - it only adds CPU overhead,
which is less of an issue when things tend to be I/O bound.

> How can I build a debug-build of xapian?

What do you mean by a "debug build"?

If you use GCC, configure compiles with "-g -O2" by default, so you have
debug symbols by default.

INSTALL documents how to enable assertions, but that's not useful for leak
detection.

HACKING documents enabling call logging (but that's not useful for leak
checking either), and also has a section on "Using various debugging,
profiling, and leak-finding tools", but nobody's documented what is required
for dmalloc yet.

I don't know anything about dmalloc, so you'll need to figure that part out
yourself.  If you can produce a "recipe" for using dmalloc, let me know and
I'll add it to the documentation.

Note that for leak checking C++ code, you probably also want to set
GLIBCXX_FORCE_NEW=1 in the environment and export it, otherwise STL memory
pooling will confuse the issue (tests/runtest does this for the testsuite
when running under valgrind).

Cheers,
    Olly



More information about the Xapian-discuss mailing list