[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#191295: libc6-dev: malloc_stats() segfaults if you don't first allocate memory



Package: libc6-dev
Version: 2.3.1-16
Severity: normal

this program runs fine when FULL is defined and segfaults when it's not.

i've seen this behavior on sarge (glibc 2.3.1), but it doesn't appear to  
happen on glibc 2.2.5 or 2.1.x.

i think malloc_stats() segfaults when it's called without first
allocating dynamic memory.

here is the code:

#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
// #define FULL

int main(void)
{

#ifdef FULL
   char *p = (char *) malloc(20*sizeof(char));
#endif

   malloc_stats();

#ifdef FULL
   free(p);
   malloc_stats();
#endif

   return 0;
}


pete



-- System Information
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux satan 2.4.20 #4 SMP Mon Mar 24 08:52:15 PST 2003 i686
Locale: LANG=en_US, LC_CTYPE=en_US

Versions of packages libc6-dev depends on:
hi  libc6                         2.3.1-16   GNU C Library: Shared libraries an




Reply to: