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

David Holmes dholmes at openjdk.org
Wed Jul 3 21:44:22 UTC 2024


On Wed, 3 Jul 2024 04:53:35 GMT, Ioi Lam <iklam 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.
>
> Looks like a reasonable change to not depend on core lib classes.

Thanks for the reviews @iklam  and @tstuefe !

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

PR Comment: https://git.openjdk.org/jdk/pull/19894#issuecomment-2207359529


More information about the hotspot-runtime-dev mailing list