[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:49:00 GMT 2018


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

--- Comment #2 from mail at nh2 dot me ---
Created attachment 11486
  --> https://sourceware.org/bugzilla/attachment.cgi?id=11486&action=edit
Patch making malloc_stats() output not overflow

I also encountered this issue of malloc_stats() reporting completely wrong
numbers for my system.

I have attached a patch that fixes the problem.

It does not modify the public interface of `mallinfo()`.

Instead, it adds a new `mallinfo64()` function and struct that does not use
`int` internally, and makes `malloc_stats()` use that.

I have added the `struct mallinfo64` to malloc.h in the hope that
`mallinfo64()`  will be exported in the future as well.
If this is not desired, let me know, and I'll move it somewhere more private.

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


More information about the Glibc-bugs mailing list