This is the mail archive of the mailing list for the GCC 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]

[committed] Fix PR boehm-gc/33442

The enclosed patch fixes PR boehm-gc/33442.  This is a regression
on hppa-*-linux-gnu exposed by corrections to the stack allocation
on STACK_GROWS_UP targets using NPTL threads.  This caused garbage
collection in java applications to break across the board.

The POSIX specification and SUSV3 state that the stack address
returned by pthread_attr_getstack is the base (lowest addressable
byte) of the storage created for a thread's stack.  Thus, it is
incorrect to subtract the size of this storage on STACK_GROWS_UP
targets to calculate the stack base address.

Hans Boehm indicated that this problem is fixed upstream in gc7.

Tested on hppa-unknown-linux-gnu (debian lenny).  Committed as
obvious to the trunk.  Will commit to branches in a few days if
no problems are reported.

Thanks to Carlos O'Donell for help in resolving this issue.

J. David Anglin                        
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)

2007-10-10  John David Anglin  <>

	PR boehm-gc/33442
	* pthread_support.c (GC_PTR GC_get_thread_stack_base): If stack grows
	up, return stack_addr instead of stack_addr - stack_size.

Index: pthread_support.c
--- pthread_support.c	(revision 129140)
+++ pthread_support.c	(working copy)
@@ -1153,7 +1153,7 @@
       return stack_addr + stack_size;
 #   else
-      return stack_addr - stack_size;
+      return stack_addr;
 #   endif
 # else

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