RFR: 8318306: java/util/Arrays/Sorting.java fails with "Array is not sorted at 8228-th position: 8251.0 and 8153.0" [v4]

Jatin Bhateja jbhateja at openjdk.org
Sat Oct 21 00:58:42 UTC 2023


On Fri, 20 Oct 2023 23:05:56 GMT, Srinivas Vamsi Parasa <duke at openjdk.org> wrote:

>> The goal of this PR is to address the failure of AVX512 sort test when the following JVM options are enabled (particularly `-XX:+DeoptimizeALot`) : 
>> `-Xcomp -ea -esa -XX:CompileThreshold=100 -XX:+UnlockExperimentalVMOptions -server -XX:-TieredCompilation -XX:+DeoptimizeALot`
>> 
>> ### Description of the error: 
>> The sorting test (test/jdk/java/util/Arrays/Sorting.java) usually fails as shown below (from JBS bug report):
>> 
>> [Arrays.parallelSort] 'Test with check sum' length = 10000, random = C0FFEE, m = 128, CHAR STAGGER
>> [Arrays.parallelSort] 'Test with check sum' length = 10000, random = C0FFEE, m = 128, SHORT STAGGER
>> [Arrays.parallelSort] 'Test with check sum' length = 10000, random = C0FFEE, m = 128, FLOAT STAGGER
>> ----------System.err:(25/1026)----------
>> 
>> *** TEST FAILED ***
>> 
>> Array is not sorted at 8228-th position: 8251.0 and 8153.0
>> 
>> java.lang.RuntimeException: Test failed
>> at Sorting.fail(Sorting.java:644)
>> at Sorting.checkSorted(Sorting.java:892)
>> at Sorting.checkSorted(Sorting.java:841)
>> at Sorting.checkWithCheckSum(Sorting.java:638)
>> at Sorting.testWithCheckSum(Sorting.java:438)
>> at Sorting.testBasic(Sorting.java:109)
>> at Sorting.testCore(Sorting.java:122)
>> at Sorting.testAll(Sorting.java:140)
>> at Sorting.testAll(Sorting.java:135)
>> at Sorting.main(Sorting.java:85)
>> at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
>> at java.base/java.lang.reflect.Method.invoke(Method.java:580)
>> at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
>> at java.base/java.lang.Thread.run(Thread.java:1570)
>> 
>> JavaTest Message: Test threw exception: java.lang.RuntimeException: Test failed
>> JavaTest Message: shutting down test
>> 
>> STATUS:Failed.`main' threw exception: java.lang.RuntimeException: Test failed
>> 
>> ---------------------------------
>> ### Reproducing the error:
>> #### (1) Using test/jdk/java/util/Arrays/Sorting.java:  
>> `jtreg -jdk:$JDK_HOME/build/linux-x86_64-server-slowdebug/jdk/ -Xcomp -ea -esa -XX:CompileThreshold=100 -XX:+UnlockExperimentalVMOptions -server -XX:-TieredCompilation -XX:+DeoptimizeALot -timeoutFactor:100 -verbose:all test/jdk/java/util/Arrays/Sorting.java`
>> 
>> This failure was also reproduced independently by the author of this PR as follows:
>> **example 1:**
>> 
>> 
>> [Arrays.parallelSort] 'Test with check sum' length = 10000, random = C0FFEE, m = 2048, DOUBLE REPEATED
>> [Arrays.parallelSort] 'Test with check sum' length ...
>
> Srinivas Vamsi Parasa has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Update test to ignore unrecognized VM options

test/hotspot/jtreg/compiler/intrinsics/SortingDeoptimizationTest.java line 27:

> 25:  * @test
> 26:  * @bug 8318306
> 27:  * @run main/othervm/timeout=200 -XX:+IgnoreUnrecognizedVMOptions -Xcomp -ea -esa -XX:CompileThreshold=100 -XX:+UnlockExperimentalVMOptions -server -XX:-TieredCompilation -XX:+DeoptimizeALot SortingDeoptimizationTest 1e-2 100 50

Hi @vamsi-parasa, you are already passing -Xcomp which will trigger method compilation on first invocation, CompileThreshold may not be needed, You can pass -Xbatch instead to make compilation a blocking operation.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16230#discussion_r1367578309


More information about the hotspot-compiler-dev mailing list