Skip to content

[ros2] memory not cleaned up (memory leak?) #126

@Karsten1987

Description

@Karsten1987

We've encountered that there is a junk of memory per loaded plugin not cleaned up.
When running a minimal example with valgrind, we see the following output:

==11631== 152 bytes in 1 blocks are indirectly lost in loss record 6 of 8
==11631== at 0x4C2E0EF: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==11631== by 0x528F670: class_loader::impl::AbstractMetaObjectBase::AbstractMetaObjectBase(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) (meta_object.cpp:56)
==11631== by 0x791766A: ???
==11631== by 0x79172FE: ???
==11631== by 0x791710A: ???
==11631== by 0x7916E49: ???
==11631== by 0x7916F33: ???
==11631== by 0x7916F49: ???
==11631== by 0x40106B9: call_init.part.0 (dl-init.c:72)
==11631== by 0x40107CA: call_init (dl-init.c:30)
==11631== by 0x40107CA: _dl_init (dl-init.c:120)
==11631== by 0x40158E1: dl_open_worker (dl-open.c:575)
==11631== by 0x4010563: _dl_catch_error (dl-error.c:187)
==11631==
==11631== 267 (16 direct, 251 indirect) bytes in 1 blocks are definitely lost in loss record 7 of 8
==11631== at 0x4C2E0EF: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==11631== by 0x79170F4: ???
==11631== by 0x7916E49: ???
==11631== by 0x7916F33: ???
==11631== by 0x7916F49: ???
==11631== by 0x40106B9: call_init.part.0 (dl-init.c:72)
==11631== by 0x40107CA: call_init (dl-init.c:30)
==11631== by 0x40107CA: _dl_init (dl-init.c:120)
==11631== by 0x40158E1: dl_open_worker (dl-open.c:575)
==11631== by 0x4010563: _dl_catch_error (dl-error.c:187)
==11631== by 0x4014DA8: _dl_open (dl-open.c:660)
==11631== by 0x6C78F08: dlopen_doit (dlopen.c:66)
==11631== by 0x4010563: _dl_catch_error (dl-error.c:187)

The original issue to this: ros2/rosbag2#23

fyi @Martin-Idel-SI

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions