ViennaLS
ViennaLS copied to clipboard
Address sanitizer fails in tests
Curiously some of the tests (FileWriter, Serialize and VisualizationMesh) failed because the sanitizer found some errors:
Direct leak of 112 byte(s) in 1 object(s) allocated from:
#0 0x7f886b4e2002 in operator new(unsigned long) /usr/src/debug/gcc/gcc/libsanitizer/asan/asan_new_delete.cpp:95
#1 0x7f8863805776 in vtkIdList::New() sources/ViennaLS/build/_deps/vtk-src/Common/Core/vtkIdList.cxx:8
#2 0x555a45c11f92 in lsWriteVisualizationMesh<float, 3>::removeDuplicatePoints(vtkSmartPointer<vtkPolyData>&, double) sources/ViennaLS/include/lsWriteVisualizationMesh.hpp:92
#3 0x555a45bf0317 in lsWriteVisualizationMesh<float, 3>::apply() sources/ViennaLS/include/lsWriteVisualizationMesh.hpp:705
#4 0x555a45be1114 in main sources/ViennaLS/Tests/VisualizationMesh/VisualizationMesh.cpp:75
#5 0x7f8860645ccf (/usr/lib/libc.so.6+0x27ccf) (BuildId: 8bfe03f6bf9b6a6e2591babd0bbc266837d8f658)
Indirect leak of 32 byte(s) in 1 object(s) allocated from:
#0 0x7f886b4e2182 in operator new[](unsigned long) /usr/src/debug/gcc/gcc/libsanitizer/asan/asan_new_delete.cpp:98
#1 0x7f8863805d43 in vtkIdList::AllocateInternal(long long, long long) sources/ViennaLS/build/_deps/vtk-src/Common/Core/vtkIdList.cxx:63
#2 0x7f88638063d8 in vtkIdList::SetNumberOfIds(long long) sources/ViennaLS/build/_deps/vtk-src/Common/Core/vtkIdList.cxx:84
#3 0x555a45bf1776 in void vtkCellArray_detail::GetCellAtIdImpl::operator()<vtkCellArray::VisitState<vtkTypeInt64Array> >(vtkCellArray::VisitState<vtkTypeInt64Array>&, long long, vtkIdList*) sources/ViennaLS/build/_deps/vtk-src/Common/DataModel/vtkCellArray.h:1447
#4 0x555a45be6cc1 in void vtkCellArray::Visit<vtkCellArray_detail::GetCellAtIdImpl, long long&, vtkIdList*&, void>(vtkCellArray_detail::GetCellAtIdImpl&&, long long&, vtkIdList*&) sources/ViennaLS/build/_deps/vtk-src/Common/DataModel/vtkCellArray.h:969
#5 0x555a45be4f26 in vtkCellArray::GetCellAtId(long long, vtkIdList*) sources/ViennaLS/build/_deps/vtk-src/Common/DataModel/vtkCellArray.h:1579
#6 0x555a45be4de9 in vtkCellArray::GetNextCell(vtkIdList*) sources/ViennaLS/build/_deps/vtk-src/Common/DataModel/vtkCellArray.h:1548
#7 0x555a45c120dc in lsWriteVisualizationMesh<float, 3>::removeDuplicatePoints(vtkSmartPointer<vtkPolyData>&, double) sources/ViennaLS/include/lsWriteVisualizationMesh.hpp:94
#8 0x555a45bf0317 in lsWriteVisualizationMesh<float, 3>::apply() sources/ViennaLS/include/lsWriteVisualizationMesh.hpp:705
#9 0x555a45be1114 in main sources/ViennaLS/Tests/VisualizationMesh/VisualizationMesh.cpp:75
#10 0x7f8860645ccf (/usr/lib/libc.so.6+0x27ccf) (BuildId: 8bfe03f6bf9b6a6e2591babd0bbc266837d8f658)
SUMMARY: AddressSanitizer: 144 byte(s) leaked in 2 allocation(s).
We should probably investigate those further
Originally posted by @Curve in https://github.com/ViennaTools/ViennaLS/issues/99#issuecomment-1831745719