From owner-freebsd-stable Thu Mar 7 19:24:40 2002 Delivered-To: freebsd-stable@freebsd.org Received: from rcreighton.org (webster-cable-133.web-ster.com [12.111.177.134]) by hub.freebsd.org (Postfix) with ESMTP id 1880E37B404 for ; Thu, 7 Mar 2002 19:24:34 -0800 (PST) Received: (from randy@localhost) by rcreighton.org (8.11.6/8.11.6) id g283P1b02925 for freebsd-stable@freebsd.org; Thu, 7 Mar 2002 19:25:01 -0800 (PST) (envelope-from randy) Message-ID: X-Mailer: XFMail 1.5.2 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <200203070351.g273pdb63445@apollo.backplane.com> Date: Thu, 07 Mar 2002 19:25:01 -0800 (PST) From: randy@rcreighton.org To: freebsd-stable@freebsd.org Subject: RE: patch (was Re: reproducable panic with python) Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Sorry for seeming like a dunderhead, but I have a 486 that will compile a kernel without problems but crashes with a page fault under heavy load while running as a natd gateway. I chalked it up to intermittant hardware, will this patch possibly fix my problem? thanks, Randy On 07-Mar-2002 Matthew Dillon wrote: > This should fix it. Included below is the test program to reproduce > the panic and the patch that will fix it. > > The mmap() that triggers it is a MAP_ANON|MAP_NOSYNC mmap. > > I am starting a commit cycle now. > > -Matt > >#include >#include >#include >#include >#include >#include > >#define SIZE (512*1024*1024) >#define SYNC (1*1024*1024) > > int > main(int ac, char **av) > { > void *ptr; > > ptr = mmap(NULL, 4096, PROT_READ, MAP_ANON, -1, 0); > assert(ptr != MAP_FAILED); > ptr = mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_ANON|MAP_NOSYNC, -1, 0); > assert(ptr != MAP_FAILED); > msync(ptr, 4096, 0); > } > > > Index: vm/vm_map.c > =================================================================== > RCS file: /home/ncvs/src/sys/vm/vm_map.c,v > retrieving revision 1.187.2.12 > diff -u -r1.187.2.12 vm_map.c > --- vm/vm_map.c 10 Nov 2001 22:27:09 -0000 1.187.2.12 > +++ vm/vm_map.c 7 Mar 2002 03:45:42 -0000 > @@ -1741,8 +1741,11 @@ > * to write out. > * We invalidate (remove) all pages from the address space > * anyway, for semantic correctness. > + * > + * note: certain anonymous maps, such as MAP_NOSYNC maps, > + * may start out with a NULL object. > */ > - while (object->backing_object) { > + while (object && object->backing_object) { > object = object->backing_object; > offset += object->backing_object_offset; > if (object->size < OFF_TO_IDX( offset + size)) > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-stable" in the body of the message -- ---------------------------------- E-Mail: randy@rcreighton.org Date: 07-Mar-2002 Time: 19:19:38 This message was sent by XFMail ---------------------------------- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message