public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/3973] New: malloc_stats/struct mallinfo is not 64bits ready
@ 2007-02-05 22:07 madcoder at debian dot org
  2007-02-06  0:23 ` [Bug libc/3973] " drepper at redhat dot com
  0 siblings, 1 reply; 2+ messages in thread
From: madcoder at debian dot org @ 2007-02-05 22:07 UTC (permalink / raw)
  To: glibc-bugs

the struct mallinfo has its field of type `int' making it wrap on 64bits 
architectures (amd64 e.g.).

an obvious test case is:

----8<------------------
#include <malloc.h>
#include <stdio.h>
#include <stdlib.h>

#define CHUNK  0x40000000

int main(void) {
    ssize_t size = 0;
    int i;

    for (i = 0; i < 5; i++) {
        void *p = malloc(CHUNK);

        if (p) {
            size += CHUNK;
            fprintf(stderr, "Chunk %d: [total %dMb]\n", i, (int)(size >> 20));
            malloc_stats();
            fputc('\n', stderr);
        }
    }

    return 0;
}
---->8------------------

===============================================================
make a ; ./a
cc     a.c   -o a
Chunk 0: [total 1024Mb]
Arena 0:
system bytes     =          0
in use bytes     =          0
Total (incl. mmap):
system bytes     = 1073745920
in use bytes     = 1073745920
max mmap regions =          1
max mmap bytes   = 1073745920

Chunk 1: [total 2048Mb]
Arena 0:
system bytes     =          0
in use bytes     =          0
Total (incl. mmap):
system bytes     = 2147491840
in use bytes     = 2147491840
max mmap regions =          2
max mmap bytes   = 2147491840

Chunk 2: [total 3072Mb]
Arena 0:
system bytes     =          0
in use bytes     =          0
Total (incl. mmap):
system bytes     = 3221237760
in use bytes     = 3221237760
max mmap regions =          3
max mmap bytes   = 3221237760

Chunk 3: [total 4096Mb]
Arena 0:
system bytes     =          0
in use bytes     =          0
Total (incl. mmap):
system bytes     =      16384
in use bytes     =      16384
max mmap regions =          4
max mmap bytes   = 4294983680

Chunk 4: [total 5120Mb]
Arena 0:
system bytes     =          0
in use bytes     =          0
Total (incl. mmap):
system bytes     = 1073762304
in use bytes     = 1073762304
max mmap regions =          5
max mmap bytes   = 5368729600


FYI it's debian bug http://bugs.debian.org/336608

-- 
           Summary: malloc_stats/struct mallinfo is not 64bits ready
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: drepper at redhat dot com
        ReportedBy: madcoder at debian dot org
                CC: glibc-bugs at sources dot redhat dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=3973

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug libc/3973] malloc_stats/struct mallinfo is not 64bits ready
  2007-02-05 22:07 [Bug libc/3973] New: malloc_stats/struct mallinfo is not 64bits ready madcoder at debian dot org
@ 2007-02-06  0:23 ` drepper at redhat dot com
  0 siblings, 0 replies; 2+ messages in thread
From: drepper at redhat dot com @ 2007-02-06  0:23 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From drepper at redhat dot com  2007-02-06 00:23 -------
This is an ABI, it cannot be changed.  Live with it.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX


http://sourceware.org/bugzilla/show_bug.cgi?id=3973

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-02-06  0:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-05 22:07 [Bug libc/3973] New: malloc_stats/struct mallinfo is not 64bits ready madcoder at debian dot org
2007-02-06  0:23 ` [Bug libc/3973] " drepper at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).