aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorodaira <odaira@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-04 18:14:18 +0000
committerodaira <odaira@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-04 18:14:18 +0000
commit01a5bb58f8284fa3d0b1d030e131d0a0675cd01f (patch)
tree39617f1adfcec2043cc73ff06db896617a966ed4
parentbdc8d1fe106d27a8c4fe8769d44e3d7e0735cfc3 (diff)
downloadruby-01a5bb58f8284fa3d0b1d030e131d0a0675cd01f.tar.gz
* 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
-rw-r--r--ChangeLog6
-rw-r--r--thread_pthread.c5
2 files changed, 10 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 37e9b4f457..6dcc17d637 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Sat Mar 5 03:07:40 2016 Rei Odaira <Rei.Odaira@gmail.com>
+
+ * thread_pthread.c (getstack): __pi_stacksize returned by
+ pthread_getthrds_np() is wrong on AIX. Use
+ __pi_stackend - __pi_stackaddr instead.
+
Fri Mar 4 19:19:42 2016 Koichi Sasada <ko1@atdot.net>
* gc.c: use 2 bits with unsigned int for rb_objspace::flags::mode
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),
&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;