From owner-freebsd-current Thu Aug 6 18:34:20 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id SAA24501 for freebsd-current-outgoing; Thu, 6 Aug 1998 18:34:20 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.15.68.22]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id SAA24460 for ; Thu, 6 Aug 1998 18:34:09 -0700 (PDT) (envelope-from reilly@zeta.org.au) Received: from zeta.org.au (d18.syd2.zeta.org.au [203.26.11.18]) by godzilla.zeta.org.au (8.8.7/8.8.7) with ESMTP id LAA30518 for ; Fri, 7 Aug 1998 11:33:47 +1000 Received: (qmail 9802 invoked by uid 1000); 7 Aug 1998 01:02:43 -0000 From: "Andrew Reilly" Message-ID: <19980807110243.A9734@reilly.home> Date: Fri, 7 Aug 1998 11:02:43 +1000 To: Bruce Evans , wollman@khavrinen.lcs.mit.edu Cc: dg@root.com, freebsd-current@FreeBSD.ORG Subject: Re: memory leaks in libc References: <199808061723.DAA02057@godzilla.zeta.org.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.91.1i In-Reply-To: <199808061723.DAA02057@godzilla.zeta.org.au>; from Bruce Evans on Fri, Aug 07, 1998 at 03:23:29AM +1000 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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. What _does_ happen now if you do free("foo") ? 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? -- Andrew To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message