tdb, valgrind, and mmap

Martin Pool mbp at samba.org
Tue Mar 11 05:48:10 GMT 2003


If you use tdbs under valgrind, and in particular if you run
tdbtorture, you may get spurious "uninitialized value" warnings.  I
think this is because valgrind doesn't understand that the mmap'd area
may be written to by other processes.  Memory can, from the point of
view of the grinded process, spontaneously become initialized.

I can think of a few solutions.

1 - Write suppressions for Valgrind so that it doesn't complain about
this.  Probably the most reasonable but people need to remember to use
them.

2 - Use IO not mmap when running under valgrind.  Not so nice.

3 - Use the special valgrind macros to mark memory as valid at the
right time.  Probably too hard, and I'm not sure that any one process
will ever really know which parts are valid.

Any comments?

-- 
Martin 


More information about the samba-technical mailing list