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

GetCurrentThreadCpuTime accesses oops in native state

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • repo-loom
    • repo-loom
    • hotspot
    • None

      This code uses a load barrier while in native state:

      V [libjvm.so+0x32616c] AccessInternal::check_access_thread_state()+0xbc
      V [libjvm.so+0x19f0eac] JavaThread::threadObj() const+0x1c
      V [libjvm.so+0x12edeb7] JvmtiEnv::GetCurrentThreadCpuTime(long*)+0x67
      C [libVThreadUnsupportedTest.so+0x1d93] test_unsupported_jvmti_functions+0x343
      C [libVThreadUnsupportedTest.so+0x1ee1] VirtualThreadMount+0x71
      V [libjvm.so+0x1316aca] JvmtiExport::post_vthread_mount(_jobject*)+0x14a
      V [libjvm.so+0x1144190] JVM_VirtualThreadMountEnd+0x230
      j java.lang.VirtualThread.notifyJvmtiMountEnd(Z)V+0 java.base@19-internal

      This is unsafe because a safepoint might run at the same time, invalidating the oop.

      Found with extra checks in the Access API, while running VThreadUnsupportedTest.

            sspitsyn Serguei Spitsyn
            stefank Stefan Karlsson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: