https://bugs.kde.org/show_bug.cgi?id=378765
Bug ID: 378765 Summary: Invoke glibc cleanup when present (__libc_freeres) Product: Heaptrack Version: unspecified Platform: Other OS: Linux Status: UNCONFIRMED Severity: normal Priority: NOR Component: general Assignee: m...@milianw.de Reporter: maxim.go...@gmail.com Target Milestone: --- Created attachment 105019 --> https://bugs.kde.org/attachment.cgi?id=105019&action=edit Reproducer for strftime leak Several functions like strftime allocate memory on the first use which is not cleaned up on shutdown by default. heaptrack reports such allocations as memory leaks. glibc provides a cleanup method which can be used to release this memory before exit, see, for example, valgrind documentation. Attached is a reproducer. $ g++ leak-strftime.cpp $ ./a.out $ heaptrack ./a.out heaptrack output will be written to "/home/centos/work/heaptrack-eval/heaptrack.a.out.16784.gz" starting application, this might take some time... heaptrack stats: allocations: 4 leaked allocations: 3 temporary allocations: 0 Heaptrack finished! Now run the following to investigate the data: heaptrack_print "/home/centos/work/heaptrack-eval/heaptrack.a.out.16784.gz" | less $ heaptrack ./a.out noleak heaptrack output will be written to "/home/centos/work/heaptrack-eval/heaptrack.a.out.16809.gz" starting application, this might take some time... heaptrack stats: allocations: 4 leaked allocations: 0 temporary allocations: 1 Heaptrack finished! Now run the following to investigate the data: heaptrack_print "/home/centos/work/heaptrack-eval/heaptrack.a.out.16809.gz" | less -- You are receiving this mail because: You are watching all bug changes.