From owner-freebsd-bugs Thu Sep 18 15:03:10 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id PAA10728 for bugs-outgoing; Thu, 18 Sep 1997 15:03:10 -0700 (PDT) Received: from bcarsde4.localhost (mailgate.nortel.ca [192.58.194.74]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id PAA10664; Thu, 18 Sep 1997 15:02:39 -0700 (PDT) Message-Id: <199709182202.PAA10664@hub.freebsd.org> Received: from bcars520.ott.bnr.ca (actually 47.128.5.188) by bcarsde4.localhost; Thu, 18 Sep 1997 18:00:39 -0400 Received: from bnr.ca by bcars520.bnr.ca id <09907-0@bcars520.bnr.ca>; Thu, 18 Sep 1997 18:00:20 -0400 Date: 18 Sep 1997 17:59 EDT To: phk@critter.freebsd.dk Cc: hackers@FreeBSD.ORG, freebsd-bugs@FreeBSD.ORG From: "Andrew Atrens" Subject: Re: Bug in malloc/free (was: Memory leak in getservbyXXX?) Sender: owner-freebsd-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk In message "Bug in malloc/free (was: Memory leak in getservbyXXX?)", phk@critter.freebsd.dk writes: > > This is about the only way you could get it to loop I think. That means > that somebody wrote to memory malloc hadn't passed them (ie: your code). > > This would indicate a bug of the class where memory is written to after > being free()'ed, a kind of bug which phkmalloc makes no attempt to catch. Why not have free() shred memory its releasing? Shredding memory with high values can often cause the offending code (which is still attempting to r/w this memory) to bus error. >From what I can tell Poul your free() actually gives the memory back to the OS ( at least some of the time ). Perhaps Graham could hack it to *not* give back the memory to the OS ( on those occasions when it would ), and in all cases shred it. Very ungraceful, but depending on the tools available ( or unavailable as in this case ), reasonably effective. Andrew ( opinions mine, not Nortels. ) > > -- > Poul-Henning Kamp FreeBSD coreteam member > phk@FreeBSD.ORG "Real hackers run -current on their laptop." >