This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: tst-attr1.c doesn't work with NEED_SEPARATE_REGISTER_STACK


tst-attr1.c always fails on ia64:

uardsize differs 32768 != 16384

The problem is 

#ifdef NEED_SEPARATE_REGISTER_STACK
      const size_t granularity = 2 * pagesize;
      /* Try to make stacksize/2 a multiple of pagesize */
#else
      const size_t granularity = pagesize;
#endif
 
That means any systems which define NEED_SEPARATE_REGISTER_STACK will
have different guardsizes from pthread_getattr_np and
pthread_attr_init. Here is a patch.


H.J.
----
2003-09-18  H.J. Lu  <hongjiu.lu@intel.com>

	* attr.c (__pthread_attr_init_2_1): Double __guardsize size
	if NEED_SEPARATE_REGISTER_STACK is defined.

--- linuxthreads/attr.c.guard	2003-09-17 09:58:30.000000000 -0700
+++ linuxthreads/attr.c	2003-09-18 17:14:37.000000000 -0700
@@ -35,7 +35,11 @@ int __pthread_attr_init_2_1(pthread_attr
   attr->__schedparam.sched_priority = 0;
   attr->__inheritsched = PTHREAD_EXPLICIT_SCHED;
   attr->__scope = PTHREAD_SCOPE_SYSTEM;
+#ifdef NEED_SEPARATE_REGISTER_STACK
+  attr->__guardsize = ps + ps;
+#else
   attr->__guardsize = ps;
+#endif
   attr->__stackaddr = NULL;
   attr->__stackaddr_set = 0;
   attr->__stacksize = STACK_SIZE - ps;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]