RFR: 8283422: Create a new test for JDK-8254790 [v4]
Vladimir Kozlov
kvn at openjdk.java.net
Wed Mar 30 18:17:34 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
Testing results are good.
-------------
Marked as reviewed by kvn (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/7883
More information about the hotspot-compiler-dev
mailing list