Review request 6983240: guarantee((Solaris::min_stack_allowed >= (StackYellowPages+StackRedPages...) wrong

David Holmes David.Holmes at
Mon Oct 4 17:41:32 PDT 2010

Hi Coleen,

In os_solaris.cpp this comment should now refer to 2*BytesPerWord

   // Add in BytesPerWord times page size to account for VM stack during
   // class initialization depending on 32 or 64 bit VM.

That said this formulation (not your I know) is confusing. What does 
bytesPerWord have to do with the amount of stack needed? Is this just 
some weird way of getting twice the amount of stack on 64-bit as 32-bit? 
Are the pages sizes even the same in that case?

Also in os_solaris.cpp isn't this guarantee always false:

!   guarantee(os::Solaris::min_stack_allowed >= thr_min_stack(),
!             "need to increase min_stack_allowed");

AFAICS min_stack_allowed is set to one of these values:

os::Solaris::min_stack_allowed = 128*K;
os::Solaris::min_stack_allowed = 96*K;
os::Solaris::min_stack_allowed = 224*K;
os::Solaris::min_stack_allowed = 64*K;

but the manpage for thr_min_stack states:

     thr_min_stack() will return the unsigned int  THR_MIN_STACK,
     which is the minimum-allowable size for a thread's stack.

     In this implementation the default size for a  user-thread's
     stack   is   one   mega-byte.

1MB > all the above. ???


Coleen Phillimore said the following on 10/05/10 08:45:
> Summary: min_stack_allowed is a compile time constant and Stack*Pages 
> are settable
> Also stress tested various combinations of -Xss and 
> -XX:StackShadowPages=n.  This also fixes a bug
> 6346701: stack overflow in native method results in segfault, not a 
> StackOverflowError
> or rather it fixes the observed SEGVs with different settings of -Xss 
> and -XX:StackShadowPages in the evaluation.  We were getting stack 
> overflow before the stack overflow exception was initialized, causing 
> infinite recusion trying to initialize it.
> Also fixed a random g++ compilation error.
> open webrev at
> bug link at
> Thanks,
> Coleen

More information about the hotspot-runtime-dev mailing list