RFR: 8283422: Create a new test for JDK-8254790 [v4]

Sergey Bylokhov serb at openjdk.java.net
Wed Mar 30 07:56:42 UTC 2022


On Wed, 30 Mar 2022 07:03:21 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

>> The [JDK-8254790](https://bugs.openjdk.java.net/browse/JDK-8254790) initially was reported on macOS.
>> It was found by the "javax/xml/crypto/dsig/GenerationTests.java" test which for some reason worked fine on Linux/Windows most? of the time.
>> 
>> I tried to run that test on Linux/Windows many times on a few systems and it always pass. Also, I got the same result for the tier1...tier4 tests.
>> 
>> I have found that the easiest way to reproduce the crash is to pass the result of the string.indexOf to the str.charAt when the heap is big enough. The test below[1] trigger the crash 1000 time in a row on win/lin on systems I have tested.
>> 
>> I am not sure what is the best way to contribute to the test, should I create a stand-alone test like[1], or update an existing test as I did for the first version of this PR?
>> 
>> [1]:
>> 
>> package compiler.intrinsics.string;
>> 
>> import static jdk.test.lib.Asserts.assertTrue;
>> 
>> public final class TestStringIndexOfLargeHeap {
>>     static final int[] data = new int[Integer.MAX_VALUE / 2];
>>     public static void main(String[] args) throws Exception {
>>         test('a');
>>         test('\ubeef');
>>     }
>>     private static void test(char ch) {
>>         String str = ("0123456789" + ch).repeat(100);
>>         for (int i = 0; i < 1_000_000; ++i) {
>>             assertTrue(ch == str.charAt(str.indexOf(ch)));
>>         }
>>     }
>> }
>
> Sergey Bylokhov has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Add resourcehogs/compiler  to the hotspot_slow_compiler

The test is updated:
 - The special wrapper `TestStringIntrinsics2LargeArray` for the `TestStringIntrinsics2` is added to the test/hotspot/jtreg/resourcehogs/. This approach is based on the similar [test](https://github.com/openjdk/jdk/blob/edb42d7b0aabd07ef9f46cb1f0e862f7bb912378/test/hotspot/jtreg/resourcehogs/serviceability/sa/LingeredAppWithLargeArray.java#L28). Note that the tests in the `resourcehogs` folder use the `exclusiveAccess` property.
 - The new test will be executed as part of the hotspot:tier3

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

PR: https://git.openjdk.java.net/jdk/pull/7883


More information about the hotspot-compiler-dev mailing list