RFR Backport 8179083: Uninitialized notifier in Java Monitor Wait tracing event

Yangfei (Felix) felix.yang at huawei.com
Thu Sep 10 11:59:11 UTC 2020


Hi,

Please review this one-line change of 8u.

Original bug: https://bugs.openjdk.java.net/browse/JDK-8179083 
Original patch: http://hg.openjdk.java.net/jdk/jdk/rev/d5610f86423f 

The original patch does not apply cleanly to jdk8u-dev due to path difference.
Webrev for 8u: http://cr.openjdk.java.net/~fyang/8179083-8u/webrev.00/ 

The following JFR test fails randomly on one of our aarch64 linux platform:
$jtreg -othervm jdk/test/jdk/jfr/event/runtime/TestJavaMonitorWaitTimeOut.java

When it fails, we have error messages:

jdk.JavaMonitorWait {
  startTime = 10:02:30.341
  duration = 10.064 ms
  monitorClass = jdk.jfr.event.runtime.TestJavaMonitorWaitTimeOut$Lock (classLoader = sun/misc/Launcher$AppClassLoader)
  notifier = "Finalizer" (javaThreadId = 3)
  timeout = 10.000 ms
  timedOut = true
  address = 0xFFFF380044E0
  eventThread = "main" (javaThreadId = 1)
}


jdk.JavaMonitorWait {
  startTime = 10:02:30.352
  duration = 64.700 us
  monitorClass = jdk.jfr.event.runtime.TestJavaMonitorWaitTimeOut$Lock (classLoader = sun/misc/Launcher$AppClassLoader)
  notifier = "Notifier" (javaThreadId = 15)
  timeout = 40.000 s
  timedOut = false
  address = 0xFFFF380044E0
  eventThread = "main" (javaThreadId = 1)
}


jdk.JavaMonitorWait {
  startTime = 10:02:30.352
  duration = 11.062 ms
  monitorClass = jdk.jfr.event.runtime.TestJavaMonitorWaitTimeOut$Lock (classLoader = sun/misc/Launcher$AppClassLoader)
  notifier = "Finalizer" (javaThreadId = 3)
  timeout = 11.000 ms
  timedOut = true
  address = 0xFFFF380044E0
  eventThread = "main" (javaThreadId = 1)
}


Exception in thread "main" java.lang.RuntimeException: Invalid thread: expected Finalizer to equal null
        at jdk.test.lib.Asserts.fail(Asserts.java:594)
        at jdk.test.lib.Asserts.assertEquals(Asserts.java:205)
        at jdk.jfr.event.runtime.TestJavaMonitorWaitTimeOut.assertTimeOutEvent(TestJavaMonitorWaitTimeOut.java:119)
        at jdk.jfr.event.runtime.TestJavaMonitorWaitTimeOut.main(TestJavaMonitorWaitTimeOut.java:98)

Here, the notifier field of the first and third item is not correct.  "Finalizer" thread is not anticipated here.

Performed full jtreg test with release builds both on aarch64-linux and x86_64-linux platforms.
OK to backport?

Thanks,
Felix


More information about the jdk8u-dev mailing list