From 01a5bb58f8284fa3d0b1d030e131d0a0675cd01f Mon Sep 17 00:00:00 2001 From: odaira Date: Fri, 4 Mar 2016 18:14:18 +0000 Subject: * thread_pthread.c (getstack): __pi_stacksize returned by pthread_getthrds_np() is wrong on AIX. Use __pi_stackend - __pi_stackaddr instead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54000 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- thread_pthread.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'thread_pthread.c') diff --git a/thread_pthread.c b/thread_pthread.c index 738ad57ce0..ef43b369e7 100644 --- a/thread_pthread.c +++ b/thread_pthread.c @@ -619,7 +619,10 @@ get_stack(void **addr, size_t *size) &thinfo, sizeof(thinfo), ®, ®siz)); *addr = thinfo.__pi_stackaddr; - *size = thinfo.__pi_stacksize; + /* Must not use thinfo.__pi_stacksize for size. + It is around 3KB smaller than the correct size + calculated by thinfo.__pi_stackend - thinfo.__pi_stackaddr. */ + *size = thinfo.__pi_stackend - thinfo.__pi_stackaddr; STACK_DIR_UPPER((void)0, (void)(*addr = (char *)*addr + *size)); #elif defined __HAIKU__ thread_info info; -- cgit v1.2.3