[Bug malloc/25288] New: malloc: memory leak on tcache cache variable for main thread
alexander.solovyov at intel dot com
sourceware-bugzilla@sourceware.org
Tue Dec 17 13:04:00 GMT 2019
https://sourceware.org/bugzilla/show_bug.cgi?id=25288
Bug ID: 25288
Summary: malloc: memory leak on tcache cache variable for main
thread
Product: glibc
Version: 2.28
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: malloc
Assignee: unassigned at sourceware dot org
Reporter: alexander.solovyov at intel dot com
Target Milestone: ---
Created attachment 12131
--> https://sourceware.org/bugzilla/attachment.cgi?id=12131&action=edit
test sample
A test program that allocates and deallocates memory block in main(). If run
this application under Intel Inspector's leak detector with added allocator
definition on function _int_malloc, it will report memory leak with the
following callstack:
libc.so.6!tcache_init.part.5
libc.so.6!__libc_malloc
libstdc++.so.6!pool - eh_alloc.cc:123
libstdc++.so.6!__do_global_ctors_aux
libstdc++.so.6!_init
ld-linux-x86-64.so.2!call_init.part.0
ld-linux-x86-64.so.2!_dl_init
ld-linux-x86-64.so.2!_dl_start_user
This error is detected on glibc 2.28, but is not detected on 2.17. There are no
leaks for service threads if created, only main thread is affected.
It seems that there is no call to tcache_thread_shutdown() for main thread.
Potentially this could be fixed by adding atexit() handler to make this call
for main thread at application finish.
Please note that we verified the same case with mtrace() command, there is no
memory leaks, but the implementation of mtrace calls explicitly
__libc_freeres() in its handler release_libc_mem on exit.
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the Glibc-bugs
mailing list