RFR: 8334545: runtime/ClassInitErrors/TestStackOverflowDuringInit.java fails after JDK-8294960
Thomas Stuefe
stuefe at openjdk.org
Wed Jul 3 05:20:19 UTC 2024
On Wed, 26 Jun 2024 05:56:22 GMT, David Holmes <dholmes at openjdk.org> wrote:
> When the test is now run under jtreg, hundreds of other classes are initialized before we trigger the initial `StackOverflowError` - including the critical `java/lang/Long$LongCache` class. This evades the failure scenario that the test was so carefully setting up and so the test fails.
>
> We can restore the failure scenario if we use custom classes to replace `Long` and `LongCache`. This has the added advantage that the test now seems to work reliably on all mainstream platforms.
>
> The test runs with a small -Xss value based on the minimum value allowed on any of macos/linux/windows x64, and macos/linux aarch64. It is possible other platforms - PPC, S390 - may not support that value. I don't know of a way to programmatically find the minimum for the current platform at runtime.
>
> Testing:
> - test was run 10x on each mainline platform in release and debug builds.
> - logging was used (`-Xlog:exceptions=info,class+init=info` with vm.flagless removed) to check that the SOE was triggering where expected and the NCDFE is thrown.
>
> Thanks.
LGTM
-------------
Marked as reviewed by stuefe (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/19894#pullrequestreview-2155476503
More information about the hotspot-runtime-dev
mailing list