[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#881772: ruby2.5: FTBFS on ppc64(el): stack level too deep



Hello,

On 11/15/2017 02:32 PM, Antonio Terceiro wrote:
>> Could you please take a look?

I had a chance to take a look at this issue and I found that this regression was caused by
the following commit id, and reverting it would allow the test to pass again.


 commit c4e2cf466448f4283fd3f8a17a73f5fa9b745fe1
 Author: normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
 Date:   Thu Jun 8 20:58:03 2017 +0000

     tool/runruby.rb: test with smallest possible machine stack
    
     Lets ensure none of our C functions use too much stack space and
     fix all excessive stack usage before releasing the next version.
     Reducing C stack usage should reduce conservative GC scanning
     time and improve performance.
    
     If there are platform-dependent test failures; excessive stack
     usage should be fixed; rather than increasing minimum values or
     removing these envs from testing.


This commit seems to be interim to guarantee that nothing is quite broken.

Looking further at the issue, I think that the stack alignment is wrong for ppc64el. ppc64el
uses 64k page size, so, if align the stack into the page, we do not see this issue, as the
following patch fixes the issue.


 commit aa11d386528bbeb0f138962b3073b01319e85678
 Author: Breno Leitao <leitao@debian.org)
 Date:   Mon Nov 27 10:47:00 2017 -0500

     stack: align to 64kb
    
     This is a workaround for ppc64el which uses 64kb page size. This align
     the stack to the page size. It shouldn't have issues with amd64, but I
     am not the expert.
    
     Signed-off-by: Breno Leitao <leitao@debian.org>

 diff --git a/vm_core.h b/vm_core.h
 index 41663fd43e..71f5ee5ba2 100644
 --- a/vm_core.h
 +++ b/vm_core.h
 @@ -576,7 +576,7 @@ typedef struct rb_vm_struct {
 
  /* default values */
 
 -#define RUBY_VM_SIZE_ALIGN 4096
 +#define RUBY_VM_SIZE_ALIGN 4096 * 16
 
  #define RUBY_VM_THREAD_VM_STACK_SIZE          ( 128 * 1024 * sizeof(VALUE))  /*  512 KB or 1024 KB */
  #define RUBY_VM_THREAD_VM_STACK_SIZE_MIN      (   2 * 1024 * sizeof(VALUE))  /*    8 KB or   16 KB */


I will now get in touch with the Ruby community to see their opinion about it.
I will keep this bug updated.


Reply to: