Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

Commit 6449dfb

Browse files
author
Yuri Nesterenko
committed
8272472: StackGuardPages test doesn't build with glibc 2.34
Backport-of: f77a1a156f3da9068d012d9227c7ee0fee58f571
1 parent 7e5b8d3 commit 6449dfb

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
@@ -67,8 +67,17 @@ static void handler(int sig, siginfo_t *si, void *unused) {
6767
longjmp(context, 1);
6868
}
6969

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

7382
stack_t ss = {
7483
.ss_size = SIGSTKSZ,

0 commit comments

Comments
 (0)