Create on behalf of https://github.com/mz1999 which copy from https://github.com/openjdk/jdk/pull/25689
The TestStackGuardPagesNative.java test hangs and times out on some Linux distributions (e.g., CentOS 7) during the test_native_overflow_initial scenario.
This issue is a regression introduced by the "hardening" fix inJDK-8295344. That fix correctly replaced a recursive implementation in exeinvoke.c (which caused stack corruption, see JDK-8293452) with an iterative for(;;) loop.
However, this unbounded loop relies on an incidental SIGSEGV (e.g., SEGV_MAPERR) to terminate. On platforms like CentOS 7, this signal does not occur in a timely manner, causing the native process to hang indefinitely.
The proposed solution is to make the iterative loop bounded by checking against the previously recorded overflow depth (_kp_rec_count). This retains the benefit of the iterative approach (no stack corruption) while fixing the hang, making the test's behavior deterministic and platform-independent.
The TestStackGuardPagesNative.java test hangs and times out on some Linux distributions (e.g., CentOS 7) during the test_native_overflow_initial scenario.
This issue is a regression introduced by the "hardening" fix in
However, this unbounded loop relies on an incidental SIGSEGV (e.g., SEGV_MAPERR) to terminate. On platforms like CentOS 7, this signal does not occur in a timely manner, causing the native process to hang indefinitely.
The proposed solution is to make the iterative loop bounded by checking against the previously recorded overflow depth (_kp_rec_count). This retains the benefit of the iterative approach (no stack corruption) while fixing the hang, making the test's behavior deterministic and platform-independent.
- links to
-
Review(master) openjdk/jdk/27114