Dear David, Mike, Kevin, etc Thank you all for quick responses. Mike and David were right, it is a wrapper in rdesktop.c, thanks for pointing it out. Some of the code used Malloc, some used Xmalloc. So I've made it consistently use xmalloc as it has error checking
Stil getting segmentation fault, trace show it occurs upon calling malloc Could this mean something is corrupting the heap / malloc's housekeeping such that malloc panics? -----Original Message----- From: David Daney [mailto:[EMAIL PROTECTED] Sent: Thursday, May 03, 2007 12:48 PM To: [EMAIL PROTECTED] Cc: Mike Frysinger; [email protected] Subject: Re: What is XMALLOC and how it compares with malloc? [EMAIL PROTECTED] wrote: > Dear Mike, > > thanks for quickly getting back to me. > > The application is RDESKTOP. It has mess of both malloc and xmalloc. > Runs fine on Fedora Core (presumely glibc) but get segfaults under Cirrus ARM > linux which uses libcClibc-0.9.28.so So, I'm trying to understand and > trace the memory management. Whats frustrating is not finding any > decent explanation thru google about XMALLOC. Not even wikipedia! > Wow, not even in wikipedia?! Have you tried looking at the source code of the function? According to your grep, you should be able to find it in rdesktop.c. David Daney > > GREP MALLOC > > cache.c: text->data = xmalloc(length); > nwin.c: uint8 *d2 = xmalloc(width * height); > nwin.c: uint8 *d2 = xmalloc(width * height * (depth / 8)); > nwin.c: bmp = (GR_IMAGE_HDR*)malloc(sizeof(GR_IMAGE_HDR)); > nwin.c: bmp->palette = (MWPALENTRY*)malloc(2 * sizeof(MWPALENTRY)); > nwin.c: bmp->imagebits = (MWUCHAR*)malloc(datasize); > nwin.c:STATUS("doing malloc - sizeof %d\n",sizeof(GR_PALETTE) ); > nwin.c: pal = (GR_PALETTE*)malloc(sizeof(GR_PALETTE)); > nwin.c: STATUS("malloc error!\n"); > nwin.c: pixels = (GR_PIXELVAL*)malloc(cx * cy * depth); > orders.c: d2 = xmalloc(width*height); > orders.c: bmpdata = xmalloc(width * height); > orders.c: map.colours = xmalloc(3 * map.ncolours); > orders.c: rev_data = xmalloc(datasize); > rdesktop.c:#include <stdlib.h> /* malloc realloc free */ > rdesktop.c: char *errormsg = (char *)malloc(500); > rdesktop.c:/* malloc; exit if out of memory */ rdesktop.c:void > *xmalloc2(int l, char *s, int size) > rdesktop.c: void *mem = malloc(size); > rdesktop.c: ERROR("xmalloc %d\n", size); > rdesktop.c:/* malloc; exit if out of memory */ rdesktop.c:void > *xmalloc(int size) > rdesktop.c: void *mem = malloc(size); > rdesktop.c: ERROR("xmalloc %d\n", size); > rdp.c: rawdata = xmalloc(width * height); > rdp.c: rawdata = xmalloc(width * height); > secure.c: mcs_data.p = mcs_data.data = xmalloc(mcs_data.size); > tcp.c: in.data = xmalloc(in.size); > tcp.c: out.data = xmalloc(out.size); > _______________________________________________ uClibc mailing list [email protected] http://busybox.net/cgi-bin/mailman/listinfo/uclibc
