ruby-changes:41926
From: odaira <ko1@a...>
Date: Sat, 5 Mar 2016 03:14:23 +0900 (JST)
Subject: [ruby-changes:41926] odaira:r54000 (trunk): * thread_pthread.c (getstack): __pi_stacksize returned by
odaira 2016-03-05 03:14:18 +0900 (Sat, 05 Mar 2016) New Revision: 54000 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=54000 Log: * thread_pthread.c (getstack): __pi_stacksize returned by pthread_getthrds_np() is wrong on AIX. Use __pi_stackend - __pi_stackaddr instead. Modified files: trunk/ChangeLog trunk/thread_pthread.c Index: thread_pthread.c =================================================================== --- thread_pthread.c (revision 53999) +++ thread_pthread.c (revision 54000) @@ -619,7 +619,10 @@ get_stack(void **addr, size_t *size) https://github.com/ruby/ruby/blob/trunk/thread_pthread.c#L619 &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; Index: ChangeLog =================================================================== --- ChangeLog (revision 53999) +++ ChangeLog (revision 54000) @@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Sat Mar 5 03:07:40 2016 Rei Odaira <Rei.Odaira@g...> + + * 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@a...> * gc.c: use 2 bits with unsigned int for rb_objspace::flags::mode -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/