Date: 18 Sep 1997 17:59 EDT From: "Andrew Atrens" <atrens@nortel.ca> To: phk@critter.freebsd.dk Cc: hackers@FreeBSD.ORG, freebsd-bugs@FreeBSD.ORG Subject: Re: Bug in malloc/free (was: Memory leak in getservbyXXX?) Message-ID: <199709182202.PAA10664@hub.freebsd.org>
next in thread | raw e-mail | index | archive | help
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." >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199709182202.PAA10664>