rdmenezes / wvstreams

Automatically exported from code.google.com/p/wvstreams
0 stars 0 forks source link

Make default valgrind suppression for WvStreamsDebugger #8

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When running the unit tests with Valgrind, it thinks that WvStreamsDebugger
might be leaking memory.  It's not, it just allocates some stuff statically
at startup which Valgrind never sees freed due to the nature of WvTest.  We
should add a suppression to the default suppresions.wv file to exclude the
following:

==31602== 11,476 bytes in 8 blocks are possibly lost in loss record 4 of 4
==31602==    at 0x4021396: malloc (vg_replace_malloc.c:149)
==31602==    by 0x42B0746: operator new(unsigned) (in
/home/pmccurdy/src/alumnit/wvstreams/libwvbase.so)
==31602==    by 0x42B07DC: operator new[](unsigned) (in
/home/pmccurdy/src/alumnit/wvstreams/libwvbase.so)
==31602==    by 0x428FD53: WvStreamsDebugger::add_command(WvFastString
const&, WvCallback<void*, WvFastString const&, E, E, E, E, E, E, E>,
WvCallback<WvString, WvFastString const&, WvStringList&, WvCallback<void,
WvFastString const&, WvStringList&, E, E, E, E, E, E>, void*, E, E, E, E>,
WvCallback<void, WvFastString const&, void*, E, E, E, E, E, E>)
(wvhashtable.h:189)
==31602==    by 0x4293740: WvStream::add_debugger_commands() (wvstream.cc:211)
==31602==    by 0x4294796: WvStream::WvStream() (wvstream.cc:243)
==31602==    by 0x4283301: WvFdStream::WvFdStream(int, int) (wvfdstream.cc:62)
==31602==    by 0x42AF0A7: _WvConStream::_WvConStream(int, int,
WvFastString const&) (wvconstream.cc:52)
==31602==    by 0x42AF3DC: __static_initialization_and_destruction_0(int,
int) (wvconstream.cc:95)
==31602==    by 0x42BA015: (within
/home/pmccurdy/src/alumnit/wvstreams/libwvbase.so)

For perspective, running the full suite of unit tests generated a 1.5 MB
valgrind log file, filled mainly with these entries.

Original issue reported on code.google.com by peter.mc...@gmail.com on 9 Mar 2007 at 4:08

GoogleCodeExporter commented 9 years ago
Valgrind wrote the following suppression for me, but then refused to actually
suppress the error, with either Valgrind 3.2.0 in Ubuntu 6.10, or with the 
latest
3.2.3 downloaded myself.

I don't know whether it's because Valgrind won't suppress warnings, has a bug 
where
it ignores the suppression (apparently a possibility with 3.2.0), or generated 
a bad
suppression.

{
   WvStreamsDebugger_has_a_static_WvList
   Memcheck:Leak
   fun:_vgrZU_libcZdsoZa_malloc
   fun:_Znwj
   fun:_Znaj
   fun:_ZN17WvStreamsDebugger11add_commandERK12WvFastString10WvCallbackIPvS2_1ES
   fun:_ZN8WvStream21add_debugger_commandsEv
   fun:_ZN8WvStreamC2Ev
   fun:_ZN10WvFdStreamC2Eii
   fun:_ZN12_WvConStreamC1EiiRK12WvFastString
   fun:_Z41__static_initialization_and_destruction_0ii
}

Original comment by peter.mc...@gmail.com on 10 Mar 2007 at 10:26

GoogleCodeExporter commented 9 years ago
Yeah, I can't seem to suppress it either. Weird.

Original comment by wrl...@gmail.com on 11 Apr 2007 at 4:23

GoogleCodeExporter commented 9 years ago
I ended up suppressing a bunch of stuff in r11844, including apparently 
something
that suppressed this.  That sounds a bit fishy though, maybe other code changed 
such
that Valgrind stopped whining so much.  Anyway, with Ubuntu 7.10 and its 
Valgrind
3.2.3, the log file is down to 222 KB after a full unit test run, and is mostly 
just
saying "no problems found".

Original comment by peter.mc...@gmail.com on 10 Jan 2008 at 12:47