Date: Fri, 07 Aug 1998 07:46:18 +0200 From: Poul-Henning Kamp <phk@critter.freebsd.dk> To: "Andrew Reilly" <reilly@zeta.org.au> Cc: Bruce Evans <bde@zeta.org.au>, wollman@khavrinen.lcs.mit.edu, dg@root.com, freebsd-current@FreeBSD.ORG Subject: Re: memory leaks in libc Message-ID: <1676.902468778@critter.freebsd.dk> In-Reply-To: Your message of "Fri, 07 Aug 1998 11:02:43 %2B1000." <19980807110243.A9734@reilly.home>
next in thread | previous in thread | raw e-mail | index | archive | help
In message <19980807110243.A9734@reilly.home>, "Andrew Reilly" writes: >On Fri, Aug 07, 1998 at 03:23:29AM +1000, Bruce Evans wrote: >> >So you both agree, then, that there is no point in wasting any more >> >time on this? >> >> Not quite. It should be fixed someday. > >I always thought it odd that there were no implimentations of >free() that were able to identify whether the pointer that they >were passed was something that malloc had handed out previously. >Surely malloc's data structures must have something to say about >it. > >If free() could know this, then things like setenv could just go >ahead and call free(), and if the previous object had not been >malloc'ed then nothing would happen. Depends on your malloc(), phkmalloc can do this, and will issue a warning if you do something stupid. >Answering my own question with a small experiment: the free >routine prints this message to stderr: > >foo in free(): warning: junk pointer, too low to make sense. > >Is there any way to turn the message off, and rely on the benign >behaviour? no. -- Poul-Henning Kamp FreeBSD coreteam member phk@FreeBSD.ORG "Real hackers run -current on their laptop." "ttyv0" -- What UNIX calls a $20K state-of-the-art, 3D, hi-res color terminal To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1676.902468778>