JDK-8286263 : compiler/c1/TestPinnedIntrinsics.java failed with "RuntimeException: testCurrentTimeMillis failed with -3"
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11,17,19
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: os_x
  • CPU: aarch64
  • Submitted: 2022-05-05
  • Updated: 2022-09-19
  • Resolved: 2022-05-06
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 17 JDK 19
17.0.6-oracleFixed 19 b22Fixed
Related Reports
Relates :  
Description
The following test failed in the JDK19 CI:

compiler/c1/TestPinnedIntrinsics.java

Here's a snippet from the log file:

#section:main
----------messages:(4/588)----------
command: main -XX:TieredStopAtLevel=1 -Xbatch -XX:CompileCommand=dontinline,compiler.c1.TestPinnedIntrinsics::checkNanoTime -XX:CompileCommand=dontinline,compiler.c1.TestPinnedIntrinsics::checkCurrentTimeMillis compiler.c1.TestPinnedIntrinsics
reason: User specified action: run main/othervm -XX:TieredStopAtLevel=1 -Xbatch -XX:CompileCommand=dontinline,compiler.c1.TestPinnedIntrinsics::checkNanoTime -XX:CompileCommand=dontinline,compiler.c1.TestPinnedIntrinsics::checkCurrentTimeMillis compiler.c1.TestPinnedIntrinsics 
Mode: othervm [/othervm specified]
elapsed time (seconds): 0.354
----------configuration:(0/0)----------
----------System.out:(2/203)----------
CompileCommand: dontinline compiler/c1/TestPinnedIntrinsics.checkNanoTime bool dontinline = true
CompileCommand: dontinline compiler/c1/TestPinnedIntrinsics.checkCurrentTimeMillis bool dontinline = true
----------System.err:(13/868)----------
java.lang.RuntimeException: testCurrentTimeMillis failed with -3
	at compiler.c1.TestPinnedIntrinsics.checkCurrentTimeMillis(TestPinnedIntrinsics.java:58)
	at compiler.c1.TestPinnedIntrinsics.testCurrentTimeMillis(TestPinnedIntrinsics.java:53)
	at compiler.c1.TestPinnedIntrinsics.main(TestPinnedIntrinsics.java:65)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:578)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
	at java.base/java.lang.Thread.run(Thread.java:828)

JavaTest Message: Test threw exception: java.lang.RuntimeException: testCurrentTimeMillis failed with -3
JavaTest Message: shutting down test

STATUS:Failed.`main' threw exception: java.lang.RuntimeException: testCurrentTimeMillis failed with -3
----------rerun:(35/6012)*----------
Comments
A pull request was submitted for review. URL: https://git.openjdk.org/jdk17u-dev/pull/699 Date: 2022-09-19 21:20:30 +0000
19-09-2022

Fix request [17u] I backport this for parity with 17.0.6-oracle. No risk, only a test change. Clean backport. Test passes.
19-09-2022

Changeset: bb52ea68 Author: Dean Long <dlong@openjdk.org> Date: 2022-05-06 19:47:48 +0000 URL: https://git.openjdk.java.net/jdk/commit/bb52ea6820ee749b1ac07485cf1ef65c40048f13
06-05-2022

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk/pull/8566 Date: 2022-05-06 04:42:50 +0000
06-05-2022

Thanks David, I missed that.
06-05-2022

It says "testCurrentTimeMillis" and that is not monotonic. If the time-of-day clock got an adjustment at just the wrong time it could affect this test
06-05-2022

The generated code looks OK to me. I wonder if this could be a problem with os::javaTimeNanos() on osx. This page says mach_absolute_time() is monotonic, but the implementation of javaTimeNanos() is treating it like it isn't: https://developer.apple.com/documentation/kernel/1462446-mach_absolute_time
06-05-2022

ILW = test failure; intermittent on one platform; disable intrinsic = MLM = P4
06-05-2022