summaryrefslogtreecommitdiff
path: root/thread_pthread.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-29 06:15:22 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-29 06:15:22 +0000
commitc6b7092c217af2c0d6e6e92a20c02ac2845699af (patch)
tree390ec092567ab6cb8035bb24c18eed7dfc4fdd3b /thread_pthread.c
parent07c9743eb0574df423ea1750bc6287d2b1e791c8 (diff)
merge revision(s) 54000: [Backport #12148]
* 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/branches/ruby_2_3@54371 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread_pthread.c')
-rw-r--r--thread_pthread.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/thread_pthread.c b/thread_pthread.c
index 2a15816713..767805119d 100644
--- a/thread_pthread.c
+++ b/thread_pthread.c
@@ -619,7 +619,10 @@ get_stack(void **addr, size_t *size)
&thinfo, sizeof(thinfo),
&reg, &regsiz));
*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;