Memory leak in ResetPropertiesInPolygonalRegion
Description
Memory leak in the ResetPropertiesInPolygonalRegion_AllElementNodesInPolygon ctest.
Direct leak of 24 byte(s) in 1 object(s) allocated from:
#0 0x7f8e99944ca1 in operator new(unsigned long) /build/gcc/src/gcc/libsanitizer/asan/asan_new_delete.cpp:99
#1 0x7f8e92db4fc6 in GeoLib::rotatePolygonToXY(GeoLib::Polygon const&, Eigen::Matrix<double, 3, 1, 0, 3, 1>&) /var/lib/gitlab-runner/builds/e3EQ9HiK/0/ogs/ogs/GeoLib/AnalyticalGeometry.cpp:449
#2 0x555a05c24ce4 in MeshGeoToolsLib::markNodesOutSideOfPolygon(std::vector<MeshLib::Node*, std::allocator<MeshLib::Node*> > const&, GeoLib::Polygon const&) /var/lib/gitlab-runner/builds/e3EQ9HiK/0/ogs/ogs/MeshGeoToolsLib/MeshEditing/MarkNodesOutsideOfPolygon.h:28
#3 0x555a05d9864c in void MeshGeoToolsLib::resetMeshElementProperty<int>(MeshLib::Mesh&, GeoLib::Polygon const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, int, bool) /var/lib/gitlab-runner/builds/e3EQ9HiK/0/ogs/ogs/MeshGeoToolsLib/MeshEditing/ResetMeshElementProperty.h:45
#4 0x555a05c201f3 in main /var/lib/gitlab-runner/builds/e3EQ9HiK/0/ogs/ogs/Applications/Utils/MeshEdit/ResetPropertiesInPolygonalRegion.cpp:152
#5 0x7f8e8364eb24 in __libc_start_main (/usr/lib/libc.so.6+0x27b24)
Indirect leak of 64 byte(s) in 1 object(s) allocated from:
#0 0x7f8e99944ca1 in operator new(unsigned long) /build/gcc/src/gcc/libsanitizer/asan/asan_new_delete.cpp:99
#1 0x7f8e92c683f3 in __gnu_cxx::new_allocator<GeoLib::Point*>::allocate(unsigned long, void const*) /usr/include/c++/11.1.0/ext/new_allocator.h:121
#2 0x7f8e92c683f3 in std::allocator<GeoLib::Point*>::allocate(unsigned long) /usr/include/c++/11.1.0/bits/allocator.h:173
#3 0x7f8e92c683f3 in std::allocator_traits<std::allocator<GeoLib::Point*> >::allocate(std::allocator<GeoLib::Point*>&, unsigned long) /usr/include/c++/11.1.0/bits/alloc_traits.h:460
#4 0x7f8e92c683f3 in std::_Vector_base<GeoLib::Point*, std::allocator<GeoLib::Point*> >::_M_allocate(unsigned long) /usr/include/c++/11.1.0/bits/stl_vector.h:346
#5 0x7f8e92c683f3 in void std::vector<GeoLib::Point*, std::allocator<GeoLib::Point*> >::_M_realloc_insert<GeoLib::Point*>(__gnu_cxx::__normal_iterator<GeoLib::Point**, std::vector<GeoLib::Point*, std::allocator<GeoLib::Point*> > >, GeoLib::Point*&&) /usr/include/c++/11.1.0/bits/vector.tcc:440
#6 0x7f8e92c683f3 in GeoLib::Point*& std::vector<GeoLib::Point*, std::allocator<GeoLib::Point*> >::emplace_back<GeoLib::Point*>(GeoLib::Point*&&) /usr/include/c++/11.1.0/bits/vector.tcc:121
#7 0x7f8e92db56da in std::vector<GeoLib::Point*, std::allocator<GeoLib::Point*> >::push_back(GeoLib::Point*&&) /usr/include/c++/11.1.0/bits/stl_vector.h:1204
#8 0x7f8e92db56da in GeoLib::rotatePolygonToXY(GeoLib::Polygon const&, Eigen::Matrix<double, 3, 1, 0, 3, 1>&) /var/lib/gitlab-runner/builds/e3EQ9HiK/0/ogs/ogs/GeoLib/AnalyticalGeometry.cpp:452
#9 0x555a05c24ce4 in MeshGeoToolsLib::markNodesOutSideOfPolygon(std::vector<MeshLib::Node*, std::allocator<MeshLib::Node*> > const&, GeoLib::Polygon const&) /var/lib/gitlab-runner/builds/e3EQ9HiK/0/ogs/ogs/MeshGeoToolsLib/MeshEditing/MarkNodesOutsideOfPolygon.h:28
#10 0x555a05d9864c in void MeshGeoToolsLib::resetMeshElementProperty<int>(MeshLib::Mesh&, GeoLib::Polygon const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, int, bool) /var/lib/gitlab-runner/builds/e3EQ9HiK/0/ogs/ogs/MeshGeoToolsLib/MeshEditing/ResetMeshElementProperty.h:45
#11 0x555a05c201f3 in main /var/lib/gitlab-runner/builds/e3EQ9HiK/0/ogs/ogs/Applications/Utils/MeshEdit/ResetPropertiesInPolygonalRegion.cpp:152
#12 0x7f8e8364eb24 in __libc_start_main (/usr/lib/libc.so.6+0x27b24)
SUMMARY: AddressSanitizer: 88 byte(s) leaked in 2 allocation(s).
[Description of the bug or feature]
Steps to Reproduce the Problem
- Build ogs with sanitizer support
- Execute 'ResetPropertiesInPolygonalRegion' ctest
Expected behavior: Sanitizer build runs without error messages.
Actual behavior: Sanitizer build runs with error messages.
Specifications
- Version: ogs master
- Platform: arch linux
Edited by Dmitry Yu. Naumov