JDK-8318306 : java/util/Arrays/Sorting.java fails with "Array is not sorted at 8228-th position: 8251.0 and 8153.0"
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 22
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: linux
  • CPU: x86_64
  • Submitted: 2023-10-17
  • Updated: 2024-01-22
  • Resolved: 2023-10-24
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 22
22 b21Fixed
Related Reports
Relates :  
Description
The following test failed in the JDK22 CI:

java/util/Arrays/Sorting.java

Here's a snippet from log file:

#section:main
----------messages:(6/501)----------
command: main -XX:-TieredCompilation -XX:CompileCommand=CompileThresholdScaling,java.util.DualPivotQuicksort::sort,0.0001 Sorting -shortrun
reason: User specified action: run main/othervm -XX:-TieredCompilation -XX:CompileCommand=CompileThresholdScaling,java.util.DualPivotQuicksort::sort,0.0001 Sorting -shortrun 
started: Tue Oct 17 07:18:41 UTC 2023
Mode: othervm [/othervm specified, test or library overrides a system module]
finished: Tue Oct 17 07:19:11 UTC 2023
elapsed time (seconds): 30.358
----------configuration:(3/357)----------

<snip>

[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
----------rerun:(50/6633)*----------
Comments
Changeset: 1f2a80b7 Author: vamsi-parasa <srinivas.vamsi.parasa@intel.com> Committer: Sandhya Viswanathan <sviswanathan@openjdk.org> Date: 2023-10-24 18:31:33 +0000 URL: https://git.openjdk.org/jdk/commit/1f2a80b78a6378b5b03f08a1e61614b8db40654c
24-10-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/16230 Date: 2023-10-17 22:57:34 +0000
19-10-2023

ILW = Incorrect result with C2 compiled method (regression from JDK-8309130), single array sort test, -XX:DisableIntrinsic=_arraySort,_arrayPartition = HML = P2
18-10-2023

Thanks, I'll follow up in the PR.
18-10-2023

Hello Tobias (@thartmann), Could you please have a look at the proposed fix for this problem: https://github.com/openjdk/jdk/pull/16230 Thanks, Vamsi
18-10-2023

Could be a regression from JDK-8309130 or JDK-8317763 ([~sparasa], [~sviswanathan]).
17-10-2023