The 'rthread' implementation of function 'pthread_stackseq_np' returns
stack information including the default guard page in 'stack_t *sinfo'
whereas the 'uthread' implementation of that function does not include
the default guard page. The following patch makes the 'rthread'
implementation behave the same way the 'uthread' implementation behaves
updating that function to stop returning references to protected memory.



Index: rthread_np.c
===================================================================
RCS file: /cvs/src/lib/librthread/rthread_np.c,v
retrieving revision 1.7
diff -u -r1.7 rthread_np.c
--- rthread_np.c        18 Feb 2012 21:12:09 -0000      1.7
+++ rthread_np.c        26 Sep 2012 22:30:46 -0000
@@ -71,6 +71,9 @@
 #endif
                sinfo->ss_sp = base;
                sinfo->ss_size = thread->stack->len;
+               if (thread->stack->guardsize != 1)
+                       sinfo->ss_size -= thread->stack->guardsize;
+
                sinfo->ss_flags = 0;
                ret = 0;
        } else if (thread == &_initial_thread) {

Reply via email to