RFR: 8295344: Harden runtime/StackGuardPages/TestStackGuardPages.java

David Holmes dholmes at openjdk.org
Fri Feb 3 02:03:51 UTC 2023


On Thu, 2 Feb 2023 12:35:10 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:

> There are multiple ways which the stack guard pages tests can be hardened:
> - Rewritten the Java part of the test using ProcessTools.executeProcess(ProcessBuilder pb) which will make stdout/stderr be consistently logged and debugging much easier.
> - Split up initial/other thread into 2 tests
> - Split up Java thread tests and native thread tests into two separate files
> - Check more error conditions in the C code
> - Instead of recursing and creating stack frames, just `alloca()` and poke until we hit a `SIGSEGV`.
> 
> The goal is that this will help us out with  [JDK-8293452](https://bugs.openjdk.org/browse/JDK-8293452).

All seems quite reasonable. Thanks.

test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c line 77:

> 75:   if (altstack == NULL) {
> 76:     // Dynamically allocated in case SIGSTKSZ is not constant
> 77:     altstack = (char*)malloc(SIGSTKSZ);

Cast should not be necessary

-------------

Marked as reviewed by dholmes (Reviewer).

PR: https://git.openjdk.org/jdk/pull/12386


More information about the hotspot-runtime-dev mailing list