Skip to content

Commit bb7c412

Browse files
author
David Holmes
committed
8272472: StackGuardPages test doesn't build with glibc 2.34
Backport-of: f77a1a156f3da9068d012d9227c7ee0fee58f571
1 parent 567fdbf commit bb7c412

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2010, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2010, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -68,8 +68,17 @@ static void handler(int sig, siginfo_t *si, void *unused) {
6868
longjmp(context, 1);
6969
}
7070

71+
static char* altstack = NULL;
72+
7173
void set_signal_handler() {
72-
static char altstack[SIGSTKSZ];
74+
if (altstack == NULL) {
75+
// Dynamically allocated in case SIGSTKSZ is not constant
76+
altstack = malloc(SIGSTKSZ);
77+
if (altstack == NULL) {
78+
fprintf(stderr, "Test ERROR. Unable to malloc altstack space\n");
79+
exit(7);
80+
}
81+
}
7382

7483
stack_t ss = {
7584
.ss_size = SIGSTKSZ,

0 commit comments

Comments
 (0)