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-05-06
  • 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 19
19 masterFixed
Related Reports
Relates :  
The following test failed in the JDK19 CI:


Here's a snippet from the log file:

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
CompileCommand: dontinline compiler/c1/TestPinnedIntrinsics.checkNanoTime bool dontinline = true
CompileCommand: dontinline compiler/c1/TestPinnedIntrinsics.checkCurrentTimeMillis bool dontinline = true
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
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

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

Thanks David, I missed that.

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

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

ILW = test failure; intermittent on one platform; disable intrinsic = MLM = P4