https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105240
Ian Lance Taylor <ian at airs dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ian at airs dot com --- Comment #3 from Ian Lance Taylor <ian at airs dot com> --- mmap is definitely preferred. The malloc implementation is only there to support systems without mmap. That said I'm not sure I understand the valgrind report. Some of that memory is not lost as long as the program has a pointer to the backtrace_state. It's true that there is no way to release all memory allocated by the state. That is not a goal, as I expect that programs will allocate a backtrace_state and use it until the program is complete. What kinds of reports do you see if you put the backtrace_state in a global variable?