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

GetCurrentThreadCpuTime accesses oops in native state

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: repo-loom
    • Component/s: hotspot
    • Labels:
      None

      Description

      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.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated: