]> Cypherpunks repositories - gostls13.git/commit
runtime/cgo: assume Solaris thread stack is at least 1 MB
authorRuss Cox <rsc@golang.org>
Fri, 4 Dec 2015 21:10:15 +0000 (16:10 -0500)
committerRuss Cox <rsc@golang.org>
Sat, 5 Dec 2015 03:56:06 +0000 (03:56 +0000)
commitcd58f44b203b54ea3125637461d910fc447f0bad
tree61f56e6fefc223cb7f38f236fd8323bd5fbc7a5b
parent5c2483229375721e3273f61f41a9c885332592b3
runtime/cgo: assume Solaris thread stack is at least 1 MB

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/17452
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/runtime/cgo/gcc_solaris_amd64.c