[vtkusers] vtkTimerLog: leaks (valgrind)

Mathieu Malaterre Mathieu.Malaterre at creatis.insa-lyon.fr
Wed Apr 30 05:08:12 EDT 2003


Hi all,
	I have been using valgrind on TimeRenderer and TimeRenderer2 and I 
always have a leak:

==10958== 5200 bytes in 1 blocks are still reachable in loss record 24 of 44
==10958==    at 0x40166838: __builtin_vec_new (vg_clientfuncs.c:161)
==10958==    by 0x41043BB6: vtkTimerLog::AllocateLog(void) 
(/home/malat/Kitware/VTK/Common/vtkTimerLog.cxx:89)
==10958==    by 0x41043CB7: vtkTimerLog::MarkEvent(char const *) 
(/home/malat/Kitware/VTK/Common/vtkTimerLog.cxx:148)
==10958==    by 0x41043E33: vtkTimerLog::MarkStartEvent(char const *) 
(/home/malat/Kitware/VTK/Common/vtkTimerLog.cxx:232)

I am using valgrind with these options:
__GL_FORCE_GENERIC_CPU=1 valgrind -v --leak-check=yes 
--show-reachable=yes --error-limit=no

Furthermore I tried also on a simplier example:

$ valgrind CommonCxxTests otherTimerLog

And this time I get:

==11367== 156 bytes in 1 blocks are still reachable in loss record 1 of 2
==11367==    at 0x40166838: __builtin_vec_new (vg_clientfuncs.c:161)
==11367==    by 0x40378AE6: vtkTimerLog::SetMaxEntries(int) 
(/home/malat/Kitware/VTK/Common/vtkTimerLog.cxx:601)
==11367==    by 0x80736F2: otherTimerLogTest(ostream &) 
(/home/malat/Kitware/VTK/Common/Testing/Cxx/otherTimerLog.cxx:41)
==11367==    by 0x80738D3: otherTimerLog(int, char **) 
(/home/malat/Kitware/VTK/Common/Testing/Cxx/otherTimerLog.cxx:74)
==11367==


In vtkTimerLog.h, vtkTimerLogEntry is declared as a struct outside of 
the class and the allocation is outside of the constructor. So my 
question is: Does VTK reference counting works also in that case ? Or is 
this a valgrind problem ?


Thanks




More information about the vtkusers mailing list