Call libc and libstdc++ freeres functions in heaptrack_preload on exit
authorMilian Wolff <mail@milianw.de>
Mon, 17 Apr 2017 19:14:15 +0000 (21:14 +0200)
committerMilian Wolff <mail@milianw.de>
Mon, 17 Apr 2017 19:14:15 +0000 (21:14 +0200)
commit3cb1b7fd2f4b3fd656758060582001f1e78c3e12
treea20505b765aa701e881037f84f18c5cac39c6484
parente203d56632b94e6607d6cdc8710f947d644fc764
Call libc and libstdc++ freeres functions in heaptrack_preload on exit

These functions are used by Valgrind already and can be used to force
a clean shutdown of libc and libstdc++. Both usually don't bother
freeing their global resources, which used to be reported as memory
leaks by heaptrack. By calling the freeres functions we now get a
clean shutdown of the libc_leaks.c example without any memory leaks
reported.

Thanks to Maxim Golov for pointing out this hidden functionality and
providing a test case.

BUG: 378765
src/track/heaptrack_preload.cpp
tests/manual/CMakeLists.txt
tests/manual/libc_leaks.c [new file with mode: 0644]