projects/guix·blob python-team · refs

25 lines · 897 B

1Patch inspired by file comparison with openjdk@19.
2
3diff -u -r openjdk-10.alt/test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c openjdk-10/test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c
4--- openjdk-10.alt/test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c 2023-04-05 15:03:00.070787628 +0200
5+++ openjdk-10/test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c 2023-04-05 15:29:51.379824348 +0200
6@@ -67,8 +67,17 @@
7 longjmp(context, 1);
8 }
9
10-void set_signal_handler() {
11- static char altstack[SIGSTKSZ];
12+static char* altstack = NULL;
13+
14+ void set_signal_handler() {
15+ if (altstack == NULL) {
16+ // Dynamically allocated in case SIGSTKSZ is not constant
17+ altstack = (char*)malloc(SIGSTKSZ);
18+ if (altstack == NULL) {
19+ fprintf(stderr, "Test ERROR. Unable to malloc altstack space\n");
20+ exit(7);
21+ }
22+ }
23
24 stack_t ss = {
25 .ss_size = SIGSTKSZ,