077c9d
commit 3a67c72c1512f778304a5644dea2fcf5bdece274
077c9d
Author: Andreas Schwab <schwab@suse.de>
077c9d
Date:   Thu Sep 27 12:37:06 2018 +0200
077c9d
077c9d
    Fix stack overflow in tst-setcontext9 (bug 23717)
077c9d
    
077c9d
    The function f1a, executed on a stack of size 32k, allocates an object of
077c9d
    size 32k on the stack.  Make the stack variables static to reduce
077c9d
    excessive stack usage.
077c9d
    
077c9d
    (cherry picked from commit f841c97e515a1673485a2b12b3c280073d737890)
077c9d
077c9d
diff --git a/stdlib/tst-setcontext9.c b/stdlib/tst-setcontext9.c
077c9d
index db8355766ca7b906..009928235dd5987e 100644
077c9d
--- a/stdlib/tst-setcontext9.c
077c9d
+++ b/stdlib/tst-setcontext9.c
077c9d
@@ -58,7 +58,7 @@ f1b (void)
077c9d
 static void
077c9d
 f1a (void)
077c9d
 {
077c9d
-  char st2[32768];
077c9d
+  static char st2[32768];
077c9d
   puts ("start f1a");
077c9d
   if (getcontext (&ctx[2]) != 0)
077c9d
     {
077c9d
@@ -93,7 +93,7 @@ f1a (void)
077c9d
 static int
077c9d
 do_test (void)
077c9d
 {
077c9d
-  char st1[32768];
077c9d
+  static char st1[32768];
077c9d
   puts ("making contexts");
077c9d
   if (getcontext (&ctx[0]) != 0)
077c9d
     {