Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8365407

Race condition in MethodTrainingData::verify()

XMLWordPrintable

      In MTD::verify() we try to make sure the current count of deps left is consistent with the initialization state of the dependencies. However sometimes verification may happen concurrently with the reps being initialized and that causes verification failures. Shouldn't happen with 25 really (the racy call is not there) but it's best to fix it in both leyden repo and the mainline.

      # A fatal error has been detected by the Java Runtime Environment:
      #
      # Internal Error (workspace/open/src/hotspot/share/oops/trainingData.cpp:611), pid=1566217, tid=1566278
      # guarantee(init_deps_left1 == init_deps_left2) failed: mismatch: 3 2 2

      Stack: [0x00007f61a1251000,0x00007f61a1352000], sp=0x00007f61a1350258, free space=1020k
      Native frames: (J=compiled Java code, A=AOT compiled, P=AOT preloaded, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.so+0x1bd2d03] MethodTrainingData::verify()+0xa3 (trainingData.cpp:611)
      V [libjvm.so+0x1bd300f] TrainingData::verify()+0x12f (trainingData.cpp:103)
      V [libjvm.so+0x10d58da] before_exit(JavaThread*, bool)+0xdda (java.cpp:620)
      V [libjvm.so+0x129e59f] JVM_Halt+0x10f (jvm.cpp:471)
      j java.lang.Shutdown.halt0(I)V+0 java.base@25-internal
      j java.lang.Shutdown.halt(I)V+7 java.base@25-internal
      j java.lang.Shutdown.exit(I)V+16 java.base@25-internal
      j java.lang.Runtime.exit(I)V+1 java.base@25-internal
      j java.lang.System.exit(I)V+4 java.base@25-internal
      j com.sun.javatest.regtest.agent.AStatus.exit()V+55
      j com.sun.javatest.regtest.agent.MainWrapper.main([Ljava/lang/String;)V+335
      v ~StubRoutines::call_stub 0x00007f6187cab704
      V [libjvm.so+0x10da577] JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, JavaThread*)+0x4f7 (javaCalls.cpp:415)
      V [libjvm.so+0x1252e80] jni_invoke_static(JNIEnv_*, JavaValue*, _jobject*, JNICallType, _jmethodID*, JNI_ArgumentPusher*, JavaThread*) [clone .constprop.1]+0x420 (jni.cpp:883)
      V [libjvm.so+0x1256e74] jni_CallStaticVoidMethod+0x214 (jni.cpp:1712)
      C [libjli.so+0x3b9a] invokeStaticMainWithArgs+0x4a (java.c:392)
      C [libjli.so+0x4c78] JavaMain+0xf08 (java.c:640)
      C [libjli.so+0x8019] ThreadJavaMain+0x9 (java_md.c:646)
      Java frames: (J=compiled Java code, A=AOT compiled, P=AOT preloaded, j=interpreted, Vv=VM code)
      j java.lang.Shutdown.halt0(I)V+0 java.base@25-internal
      j java.lang.Shutdown.halt(I)V+7 java.base@25-internal
      j java.lang.Shutdown.exit(I)V+16 java.base@25-internal
      j java.lang.Runtime.exit(I)V+1 java.base@25-internal
      j java.lang.System.exit(I)V+4 java.base@25-internal
      j com.sun.javatest.regtest.agent.AStatus.exit()V+55
      j com.sun.javatest.regtest.agent.MainWrapper.main([Ljava/lang/String;)V+335
      v ~StubRoutines::call_stub 0x00007f6187cab704

            iveresov Igor Veresov
            iveresov Igor Veresov
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: