From owner-freebsd-threads@FreeBSD.ORG Wed Sep 8 19:09:47 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9B62716A4CE; Wed, 8 Sep 2004 19:09:47 +0000 (GMT) Received: from mail.ntplx.net (mail.ntplx.net [204.213.176.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id A063543D2F; Wed, 8 Sep 2004 19:09:42 +0000 (GMT) (envelope-from deischen@gdeb.com) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) i88J9fZx000339; Wed, 8 Sep 2004 15:09:41 -0400 (EDT) Date: Wed, 8 Sep 2004 15:09:41 -0400 (EDT) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: Brian Fundakowski Feldman In-Reply-To: <20040908174941.GF928@green.homeunix.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.ntplx.net) cc: threads@freebsd.org Subject: Re: [mistry.7@osu.edu: Re: FreeBSD and wine mmap] X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Daniel Eischen List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Sep 2004 19:09:47 -0000 On Wed, 8 Sep 2004, Brian Fundakowski Feldman wrote: > I don't think that any allocated "red zones" should be left empty -- > they should be explicitly allocated with no protection so that actually > free memory space can be explicitly searched for. Comments? Yes, that's fine. See specific comments below. > > Index: lib/libpthread/thread/thr_stack.c > > =================================================================== > > RCS file: /usr/ncvs/src/lib/libpthread/thread/thr_stack.c,v > > retrieving revision 1.8 > > diff -u -r1.8 thr_stack.c > > --- lib/libpthread/thread/thr_stack.c 14 Sep 2003 22:39:44 -0000 1.8 > > +++ lib/libpthread/thread/thr_stack.c 29 Aug 2004 04:50:28 -0000 > > @@ -214,6 +214,17 @@ > > stacksize, PROT_READ | PROT_WRITE, MAP_STACK, > > -1, 0)) == MAP_FAILED) > > attr->stackaddr_attr = NULL; > > + if (attr->stackaddr_attr != NULL) { > > + void *red; Declare red above with rest of locals. > > + > > + red = mmap((char *)attr->stackaddr_attr + stacksize, > > + _thr_guard_default, PROT_NONE, > > + MAP_ANON | MAP_FIXED | MAP_PRIVATE, -1, 0); > > + if (red == MAP_FAILED) { > > + (void)munmap(attr->stackaddr_attr, stacksize); > > + attr->stackaddr_attr = NULL; > > + } > > + } > > } > > if (attr->stackaddr_attr != NULL) > > return (0); I don't know if this was stripped of tabs, but please use them and obey style(9). -- Dan Eischen