From owner-freebsd-current Fri Aug 8 14:22:55 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id OAA15192 for current-outgoing; Fri, 8 Aug 1997 14:22:55 -0700 (PDT) Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.50]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id OAA15181 for ; Fri, 8 Aug 1997 14:22:49 -0700 (PDT) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id OAA29053; Fri, 8 Aug 1997 14:18:26 -0700 From: Terry Lambert Message-Id: <199708082118.OAA29053@phaeton.artisoft.com> Subject: Re: httpd in free(): warning: modified (page-) pointer. To: phk@dk.tfs.com (Poul-Henning Kamp) Date: Fri, 8 Aug 1997 14:18:26 -0700 (MST) Cc: wpaul@skynet.ctr.columbia.edu, andreas@klemm.gtn.com, current@FreeBSD.ORG In-Reply-To: <26184.871052158@critter.dk.tfs.com> from "Poul-Henning Kamp" at Aug 8, 97 04:55:58 pm X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > > o Electric Fence works by using mmap() to allocate memory instead > > of brk()/sbrk(). To trap out of bounds references, it allocates > > an extra page of memory immediately after the memory requested > > with malloc()/calloc()/etc and uses mprotect() to disallow > > read and write access to it. > > This is why a similar feature hasn't been implemented into phkmalloc > yet, it would only give page size granularity, ie, you have to overrun > by a LOT before you can figure it out, I tried it, and it didn't find > one single problem in the two months I ran with it so I ditched it. It would be hard to underruns without a whole lot of code, but overrruns (the most common case anyway, IMO) could be handled by allocating the memory and returning the pointer so the end is on the page boundry (followed by an unmapped page). This would actually be pretty trivial to do, I think. The real problem, I suppose, is that you would not want the code active all the time (sort of implied by where you tried this?). Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.