RFR: 8334545: runtime/ClassInitErrors/TestStackOverflowDuringInit.java fails after JDK-8294960

David Holmes dholmes at openjdk.org
Wed Jun 26 06:01:20 UTC 2024


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.

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

Commit messages:
 - 8334545: runtime/ClassInitErrors/TestStackOverflowDuringInit.java fails after JDK-8294960

Changes: https://git.openjdk.org/jdk/pull/19894/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=19894&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8334545
  Stats: 42 lines in 2 files changed: 30 ins; 4 del; 8 mod
  Patch: https://git.openjdk.org/jdk/pull/19894.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/19894/head:pull/19894

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


More information about the hotspot-runtime-dev mailing list