Bug or not? printf allocates buffer & never frees it

Godmar Back godmar@gmail.com
Wed Mar 17 20:47:31 GMT 2021


On Wed, Mar 17, 2021 at 1:46 PM Florian Weimer via Libc-help
<libc-help@sourceware.org> wrote:
>
> What happens if you remove the muntrace call?  I suspect you see this
> leak because you are specifically telling glibc not to log the
> deallocation.
>

Since you called this a `leak`, may I ask a question that is
tangentially related?

Is GNU libc designed to be used in environments that do not deallocate
all memory upon exit(), i.e., environments that can call exit()
multiple times without being provided with a fresh heap each time?  I
understand ISO C allows this and POSIX is quiet on this specific
issue. Is complete deallocation of one-time buffers before exit() a
design goal of GNU libc?

 - Godmar


More information about the Libc-help mailing list