|
From: Ian S. <ian...@st...> - 2004-03-17 12:08:05
|
Hi, We have many valgrind warnings in our test programs that I want to suppress. The one below will suffice as an example. A system call that writes a file is being passed some uninitialised bytes. The complete stack trace is 20 items long. The uniquely identifying part of this trace comes at levels 11-14, where I believe libtiff is dumping some random bytes in at the end of an image raster, in order to fix some alignment. Since the bytes are just filler in an image file, this do not represent a real error. Valgrind appears to ignore function names beyond the first 4 in a suppression. We do not want to suppress all uninitialised file writes, just ones coming though the tiff library. Is there a way to have valgrind pay attention to as many function names as are specified in a suppression? We have plenty of other examples of similar problems. Because we have coders on lots of platforms, some of whom never use valgrind directly and can't maintain such code, we can't put valgrind hooks into the source code. Ian. ==22263== Syscall param write(buf) contains uninitialised or unaddressable byte(s) ==22263== at 0x4088C324: __libc_write (in /lib/libc.so.6) ==22263== by 0x40830DF8: new_do_write (in /lib/libc.so.6) ==22263== by 0x40830D52: _IO_do_write@@GLIBC_2.1 (in /lib/libc.so.6) ==22263== by 0x4083118D: _IO_file_sync@@GLIBC_2.1 (in /lib/libc.so.6) ==22263== by 0x40827C75: _IO_fflush (in /lib/libc.so.6) ==22263== by 0x4076D160: std::__basic_file<char>::sync() (basic_file.cc:186) ==22263== by 0x407222A7: std::basic_filebuf<char, std::char_traits<char> >::_M_really_overflow(int) (/home/andrew/sw/gcc-3.2.2/objdir/i686-pc-linux-gnu/libstdc++-v3/include/bit s/fstream.tcc:350) ==22263== by 0x4072282A: std::basic_filebuf<char, std::char_traits<char> >::sync() (/home/andrew/sw/gcc-3.2.2/objdir/i686-pc-linux-gnu/libstdc++-v3/include/bit s/char_traits.h:168) ==22263== by 0x40752938: std::ostream::flush() (/home/andrew/sw/gcc-3.2.2/objdir/i686-pc-linux-gnu/libstdc++-v3/include/str eambuf:277) ==22263== by 0x4031440E: vil_stream_fstream::write(void const*, long) (/home/ian/code/src/core/vil/vil_stream_fstream.cxx:79) ==22263== by 0x402989D5: vil_tiff_writeproc(void*, void*, long) (/home/ian/code/src/core/vil/file_formats/vil_tiff.cxx:177) ==22263== by 0x40490D48: (within /usr/lib/libtiff.so.3.5.7) ==22263== by 0x404903F3: TIFFWriteEncodedStrip (in /usr/lib/libtiff.so.3.5.7) ==22263== by 0x4029AA70: vil_tiff_image::put_view(vil_image_view_base const&, unsigned, unsigned) (/home/ian/code/src/core/vil/file_formats/vil_tiff.cxx:818) ==22263== by 0x40306574: vil_save(vil_image_view_base const&, char const*, char const*) (/home/ian/code/src/core/vil/vil_save.cxx:66) ==22263== by 0x80B48D8: void vil_test_image_type<bool>(char const*, vil_image_view<bool> const&, bool, bool) (/home/ian/code/src/core/vil/tests/test_save_load_image.cxx:264) ==22263== by 0x80B3EDC: test_save_load_image() (/home/ian/code/src/core/vil/tests/test_save_load_image.cxx:500) ==22263== by 0x80B4056: test_save_load_image_main(int, char**) (/home/ian/code/src/core/vil/tests/test_save_load_image.cxx:554) ==22263== by 0x4042AFB9: testlib_main(int, char**) (/home/ian/code/src/core/testlib/testlib_main.cxx:116) ==22263== by 0x80708BE: main (/home/ian/code/src/core/vil/tests/test_driver.cxx:51) ==22263== Address 0x4044801F is not stack'd, malloc'd or free'd |
|
From: Nicholas N. <nj...@ca...> - 2004-03-18 14:10:03
|
On Wed, 17 Mar 2004, Ian Scott wrote: > We have many valgrind warnings in our test programs that I want to suppress. > The one below will suffice as an example. A system call that writes a file > is being passed some uninitialised bytes. The complete stack trace is 20 > items long. The uniquely identifying part of this trace comes at levels > 11-14, where I believe libtiff is dumping some random bytes in at the end of > an image raster, in order to fix some alignment. Since the bytes are just > filler in an image file, this do not represent a real error. > > Valgrind appears to ignore function names beyond the first 4 in a > suppression. We do not want to suppress all uninitialised file writes, just > ones coming though the tiff library. > > Is there a way to have valgrind pay attention to as many function names as > are specified in a suppression? We have plenty of other examples of similar > problems. You're right that it ignores anything past 4 names in suppressions, and unfortunately there is no way to change this. N |