[Bug malloc/21556] malloc_stats printing size_t fields as unsigned int

mail at nh2 dot me sourceware-bugzilla@sourceware.org
Sat Dec 22 19:58:00 GMT 2018


https://sourceware.org/bugzilla/show_bug.cgi?id=21556

--- Comment #3 from mail at nh2 dot me ---
Also for those that come across this bug and think they can use malloc_info()
instead, a short summary:

All 3 of 3 malloc information functions in glibc are bugged:

* mallinfo() uses `int` in the API, so it overflows at 2 GB and that is
documented in the man page
  * The man page recommends malloc_info() and malloc_stats() instead, but that
isn't helpful, because they both return wrong information
* malloc_info() does not overflow but I found that it forgets to account for
significant amounts of memory
  * https://sourceware.org/bugzilla/show_bug.cgi?id=24026
* malloc_stats() has this integer overflow bug, so it overflows at 2 GB
  * especially odd is that the mallinfo() man page recommends malloc_stats() as
a better alternative, even though it is *implemented* by calling mallinfo()!

In conclusion, it seems that nobody has used any of the malloc information
functions in anger for the last 10 years :/

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Glibc-bugs mailing list