• Russ Cox's avatar
    runtime/cgo: assume Solaris thread stack is at least 1 MB · cd58f44b
    Russ Cox authored
    When run with "ulimit -s unlimited", the misc/cgo/test test binary
    finds a stack size of 0x3000 returned by getcontext, causing the
    runtime to try to stay within those bounds and then fault when
    called back in the test after 64 kB has been used by C.
    
    I suspect that Solaris is doing something clever like reporting the
    current stack size and growing the stack as faults happen.
    On all the other systems, getcontext reports the maximum stack size.
    And when the ulimit is not unlimited, even Solaris reports the
    maximum stack size.
    
    Work around this by assuming that any stack on Solaris must be at least 1 MB.
    
    Fixes #12210.
    
    Change-Id: I0a6ed0afb8a8f50aa1b2486f32b4ae470ab47dbf
    Reviewed-on: https://go-review.googlesource.com/17452Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
    cd58f44b
gcc_solaris_amd64.c 1.75 KB