Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Sep 2004 15:09:41 -0400 (EDT)
From:      Daniel Eischen <deischen@gdeb.com>
To:        Brian Fundakowski Feldman <green@freebsd.org>
Cc:        threads@freebsd.org
Subject:   Re: [mistry.7@osu.edu: Re: FreeBSD and wine mmap]
Message-ID:  <Pine.GSO.4.43.0409081505040.7867-100000@sea.ntplx.net>
In-Reply-To: <20040908174941.GF928@green.homeunix.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.43.0409081505040.7867-100000>