runtime: make gsignal stack at least SIGSTKSZ bytes
authorIan Lance Taylor <ian@gcc.gnu.org>
Wed, 31 Aug 2016 13:59:03 +0000 (13:59 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Wed, 31 Aug 2016 13:59:03 +0000 (13:59 +0000)
    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

gcc/go/gofrontend/MERGE
libgo/runtime/runtime.c

index 633dfcfdd8aae3f3bc1073147b11ad4ae98a9dc6..71a9f5bcd5e74f4b673d23e140fe8f2d7a9c3ab8 100644 (file)
@@ -1,4 +1,4 @@
-394486a1cec9bbb81216311ed153179d9fe1c2c5
+c8cf90f2daf62428ca6aa0b5674572cd99f25fe3
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
index c7d33bcef4c65a170c343ebfc2bb13b52327c37b..9abd096555d2a6cdaf7b37a65fa72aa76efddd8e 100644 (file)
@@ -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;
 }