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

Re: Using Sunview from KCL.



    It all seemed OK until I tried to run it. In the C code, I get a "FREE(3)
    error". This occurs within Suntool's window_create function. My guess is that
    the memory allocator used inside the Suntool libaries is conflicting with the



kcl/akcl checks to make sure that a pointer handed to free was
actually allocated by malloc.

Sometimes software tries to free things that were not so allocated,
and that is when the error occurs.   You could comment out the 
check in the definition of free in c/alloc.c, so allowing bogus
calls to free.

Another possibility is that sunwindows is using another allocation
function besides malloc.   Eg valloc, which may not call malloc.

alloc.c does contain

#ifdef SUN
/* some of the basic redisplay stuff like pr_open use this */

char *valloc(size)
int size;     
{ int pagsiz = getpagesize(); 
  char *p; 
  p = malloc(size+pagsiz); 
  return (char *) ((((int) p + pagsiz - 1 ) / pagsiz )  * pagsiz );
} 
#endif

it may well be that SUN is not being defined, and so you may need to add
this to the config.h file, to ensure that a valloc which invokes
kcl/akcl malloc is used.

Bill Schelter