A guard patch for linuxthreads

H . J . Lu hjl@lucon.org
Sun Dec 19 08:45:00 GMT 1999


On Sun, Dec 19, 1999 at 08:21:16AM -0800, H . J . Lu wrote:
> On Sat, Dec 18, 1999 at 11:53:25AM -0800, Ulrich Drepper wrote:
> > I'm back for now and checked in the changes I've made over the days.
> > Mainly I've taken most of the changes I got and applied them (some of
> > them modified, e.g., HJ's thread patch).
> > 
> 
> Can we also fix linuxthread in 2.1? Also I am not quite sure if we should
> put a guard page beyond the stack bottom. Shouldn't we use this or at least
> fix the comment?
> 
> 

I believe this patch is what we want.


H.J.
--- manager.c	Sun Dec 19 07:51:27 1999
+++ /tmp/manager.c	Sun Dec 19 08:43:59 1999
@@ -315,8 +315,8 @@ static int pthread_allocate_stack(const 
       else
         {
           /* Put a bad page at the bottom of the stack */
-          guardaddr = (void *)new_thread_bottom - stacksize;
           guardsize = attr->__guardsize;
+          guardaddr = (void *)new_thread_bottom - guardsize;
           if (mmap ((caddr_t) guardaddr, guardsize, 0, MAP_FIXED, -1, 0)
               == MAP_FAILED)
             {


More information about the Libc-hacker mailing list