valgrind questions

David Relson relson at osagesoftware.com
Sun Jan 12 03:23:30 CET 2003


At 09:06 PM 1/11/03, Matthias Andree wrote:

>David Relson <relson at osagesoftware.com> writes:
>
> > Given that valgrind seems to be identifying problems within the
> > libraries we use, i.e. libc and libdb3, there seems to be little for
> > us to fix - unless we find it necessary to become db3 or libc
> > contributors :-)
>
>Not quite. If you pass e. g. a wrong buffer length to fgets, it's a
>library that does monkey business, but on your program's behalf.
>
>One thing that might warrant closer inspection is our treatment of the
>data. We do not use C strings everywhere, for example, our keys are not
>NUL-terminated. DB should cope with that.

I tend to look at the boundary line between our code and the library to see 
if there's a problem we can fix.  Seems like the typical valgrind report 
shows bogofilter calling BerkeleyDB and then, about 10 levels deeper, 
there's something that valgrind finds worth noting.  I see this pattern in 
calls to db_open(), db_flush(), __db_c_get(), etc.  Short of going deeply 
into db3, I doubt there's much we can do about these.  There _are_ a couple 
of others that may be bad args passed to strcpy.  I'll check into them.





More information about the bogofilter-dev mailing list