diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2016-08-31 13:59:03 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2016-08-31 13:59:03 +0000 |
commit | fc4eaccf101f7dab11074ef9af9b2ca71ea3e6b0 (patch) | |
tree | ca5652656a78eacecf4964497dbf32fbd729937d /libgo | |
parent | 96f14006f55ac11e82e33913f765101c28b00d27 (diff) | |
download | gcc-fc4eaccf101f7dab11074ef9af9b2ca71ea3e6b0.zip gcc-fc4eaccf101f7dab11074ef9af9b2ca71ea3e6b0.tar.gz gcc-fc4eaccf101f7dab11074ef9af9b2ca71ea3e6b0.tar.bz2 |
runtime: make gsignal stack at least SIGSTKSZ bytes
The default stack size for the gsignal goroutine, 32K, is not enough on
ia64. Make sure that the stack size is at least SIGSTKSZ.
Reviewed-on: https://go-review.googlesource.com/28224
From-SVN: r239894
Diffstat (limited to 'libgo')
-rw-r--r-- | libgo/runtime/runtime.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libgo/runtime/runtime.c b/libgo/runtime/runtime.c index c7d33bc..9abd096 100644 --- a/libgo/runtime/runtime.c +++ b/libgo/runtime/runtime.c @@ -272,7 +272,14 @@ runtime_tickspersecond(void) void runtime_mpreinit(M *mp) { - mp->gsignal = runtime_malg(32*1024, (byte**)&mp->gsignalstack, &mp->gsignalstacksize); // OS X wants >=8K, Linux >=2K + int32 stacksize = 32 * 1024; // OS X wants >=8K, Linux >=2K + +#ifdef SIGSTKSZ + if(stacksize < SIGSTKSZ) + stacksize = SIGSTKSZ; +#endif + + mp->gsignal = runtime_malg(stacksize, (byte**)&mp->gsignalstack, &mp->gsignalstacksize); mp->gsignal->m = mp; } |