Call libc and libstdc++ freeres functions in heaptrack_preload on exit

Authored by mwolff on Apr 17 2017, 7:14 PM.

Description

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

Details

Committed
mwolffApr 17 2017, 7:14 PM
Parents
R45:e203d56632b9: Disable signal handling in timer thread
Branches
Unknown
Tags
Unknown