Subject: Re: pmax and tcsh
To: Kevin Sullivan <ksulliva@psc.edu>
From: Jason Thorpe <thorpej@nas.nasa.gov>
List: port-pmax
Date: 05/27/1997 08:52:40
On Tue, 27 May 1997 11:39:49 -0400
Kevin Sullivan <ksulliva@psc.edu> wrote:
> The problem seems to be that cgetent uses calloc() to get the memory.
> Bash defines a replacement malloc and free, but not a calloc. Thus
> the memory is allocated with NetBSD's malloc and freed with bash's
> free. Crash.
>
> I haven't sent a pr since I'm not sure where the bug lies. It seems
> stupid to define your oven malloc but not calloc; but it seems odd
> that our calloc doesn't just call malloc (done for performance
> reasons, maybe?). I'm also not sure if this bug affects non-pmax
> systems.
If you look at src/lib/libc/stdlib/calloc.c, you'll note that it
simply calls malloc() and memset().
If calloc() is calling libc's malloc() instead of bash's/tcsh's malloc(),
then the bug is either in:
- the way the shared libraries are built, or
- the run-time link.
Jason R. Thorpe thorpej@nas.nasa.gov
NASA Ames Research Center Home: 408.866.1912
NAS: M/S 258-6 Work: 415.604.0935
Moffett Field, CA 94035 Pager: 415.428.6939