[Xapian-devel] Test failures

Olly Betts olly at survex.com
Mon Jun 25 00:49:20 BST 2007


On Mon, Jun 25, 2007 at 12:20:44AM +0100, Richard Boulton wrote:
> Olly Betts wrote:
> >Turns out this is a red herring.  The leaks appear to be the buffers
> >inside a stdio "FILE" structure, so the sizes probably just vary by
> >glibc version, or other unrelated factors.
> >
> >The fix is two lines, and my tree now passes all the tests!  I'll
> >check that in shortly.
> 
> Oh, well done!  I must remember that 0.1% chances happen 9 times out of 
> 10... (or whatever it is that Pratchett says).

I was thinking this counted as a false positive!

> >It seems we're leaking a file descriptor per remotetcp database opened
> >though, which isn't ideal.  That may be harder to fix though.
> 
> Does the use of valgrind not track the file descriptors as well?

Not by default, but it does with --track-fds=yes.  Not sure if there's a
good reason why we aren't using it, but if it works in our situation it
would probably have helped us locate this much sooner.

I'll try turning it on shortly.  Currently I'm trying to sort out how
best to track a pid->fd map without dynamically allocating memory
(std::map messes up the leak tracking, for example).  I think linear
scanning of a fixed size array is the sanest option - it seems we have
1-3 open child fds at once so it doesn't need to be huge, or take long
to scan.

Cheers,
    Olly



More information about the Xapian-devel mailing list