Skip to content

BUG: memory leak in maplibre-gl-native #1

Open
@brendan-ward

Description

@brendan-ward

Detected in Linux docker container, using valgrind:

==591== 64 bytes in 1 blocks are definitely lost in loss record 1,973 of 2,123
==591==    at 0x483BE63: operator new(unsigned long) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==591==    by 0xE1BF0CD: ???
==591==    by 0xD950063: ???
==591==    by 0x4011B89: call_init.part.0 (dl-init.c:72)
==591==    by 0x4011C90: call_init (dl-init.c:30)
==591==    by 0x4011C90: _dl_init (dl-init.c:119)
==591==    by 0x53E5894: _dl_catch_exception (dl-error-skeleton.c:182)
==591==    by 0x401642C: dl_open_worker (dl-open.c:758)
==591==    by 0x53E5837: _dl_catch_exception (dl-error-skeleton.c:208)
==591==    by 0x40155F9: _dl_open (dl-open.c:837)
==591==    by 0x599234B: dlopen_doit (dlopen.c:66)
==591==    by 0x53E5837: _dl_catch_exception (dl-error-skeleton.c:208)
==591==    by 0x53E5902: _dl_catch_error (dl-error-skeleton.c:227)
==591== 
==591== 5,355 bytes in 255 blocks are definitely lost in loss record 2,121 of 2,123
==591==    at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==591==    by 0x53243BE: strdup (strdup.c:42)
==591==    by 0xD4906F6: ???
==591==    by 0xD4904A4: ???
==591==    by 0xD42F0B9: ???
==591==    by 0x7498436: ??? (in /usr/lib/x86_64-linux-gnu/libGLdispatch.so.0.0.0)
==591==    by 0x7498E1C: __glDispatchMakeCurrent (in /usr/lib/x86_64-linux-gnu/libGLdispatch.so.0.0.0)
==591==    by 0x4EF9ECD: ??? (in /usr/lib/x86_64-linux-gnu/libEGL.so.1.1.0)
==591==    by 0x260B21: mbgl::gl::EGLBackendImpl::activateContext() (in /tmp/build/tests/pymgl_test)
==591==    by 0x2E0BF7: mbgl::gfx::BackendScope::BackendScope(mbgl::gfx::RendererBackend&, mbgl::gfx::BackendScope::ScopeType) (in /tmp/build/tests/pymgl_test)
==591==    by 0x3A3DD8: mbgl::Renderer::~Renderer() (in /tmp/build/tests/pymgl_test)
==591==    by 0x23198D: mbgl::HeadlessFrontend::reset() (in /tmp/build/tests/pymgl_test)
==591== 
==591== LEAK SUMMARY:
==591==    definitely lost: 5,419 bytes in 256 blocks

Looks like a backend is being created within the destructor for the Renderer class.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions