From owner-freebsd-current Thu Aug 6 22:49:45 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id WAA29867 for freebsd-current-outgoing; Thu, 6 Aug 1998 22:49:45 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from critter.freebsd.dk (critter.freebsd.dk [195.8.129.14]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id WAA29862 for ; Thu, 6 Aug 1998 22:49:42 -0700 (PDT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.8.7/8.8.5) with ESMTP id HAA01678; Fri, 7 Aug 1998 07:46:18 +0200 (CEST) To: "Andrew Reilly" cc: Bruce Evans , wollman@khavrinen.lcs.mit.edu, dg@root.com, freebsd-current@FreeBSD.ORG Subject: Re: memory leaks in libc In-reply-to: Your message of "Fri, 07 Aug 1998 11:02:43 +1000." <19980807110243.A9734@reilly.home> Date: Fri, 07 Aug 1998 07:46:18 +0200 Message-ID: <1676.902468778@critter.freebsd.dk> From: Poul-Henning Kamp Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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