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