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

ZGC: ZRuntimeWorkers incorrectly identify themselves as ZWorkers

    XMLWordPrintable

    Details

    • Subcomponent:
      gc
    • Resolved In Build:
      b26
    • Verification:
      Verified

      Backports

        Description

        ZThread::is_worker() incorrectly returns true when executed from a ZRuntimeWorkers context. This function should only return true when executed from a ZWorker context. This issue can lead to data corruption as a ZRuntimeWorker might read and write to data structures that are thread local to a ZWorker.

        #
        # A fatal error has been detected by the Java Runtime Environment:
        #
        # Internal Error (src/hotspot/share/gc/z/zThread.hpp:77), pid=8945, tid=8997
        # assert(has_worker_id()) failed: Worker id not initialized
        #
        # JRE version: Java(TM) SE Runtime Environment (12.0) (fastdebug build 12-internal+0-2018-12-17-1105080.stefan.johansson.jdk12)
        # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 12-internal+0-2018-12-17-1105080.stefan.johansson.jdk12, mixed mode, tiered, z gc, linux-amd64)
        # Problematic frame:
        # V [libjvm.so+0x195e65a] ZObjectAllocator::alloc_small_object_from_worker(unsigned long, ZAllocationFlags)+0x37a
        #

        Current thread (0x00007f6088091a80): Thread "RuntimeWorker#0" [stack: 0x00007f606dde8000,0x00007f606dee8000] [id=8997]

        Stack: [0x00007f606dde8000,0x00007f606dee8000], sp=0x00007f606dee6a50, free space=1018k
        Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
        V [libjvm.so+0x195e65a] ZObjectAllocator::alloc_small_object_from_worker(unsigned long, ZAllocationFlags)+0x37a
        V [libjvm.so+0x196802e] ZPage::relocate_object_inner(unsigned long, unsigned long)+0x2ae
        V [libjvm.so+0x19692e4] ZPage::relocate_object(unsigned long)+0x84
        V [libjvm.so+0x193d5db] ZHeap::relocate_object(unsigned long)+0x13b
        V [libjvm.so+0x9558fd] AccessInternal::PostRuntimeDispatch<ZBarrierSet::AccessBarrier<1187924ul, ZBarrierSet>, (AccessInternal::BarrierType)2, 1187924ul>::oop_access_barrier(void*)+0x34d
        V [libjvm.so+0x94ca82] ClassLoaderData::is_alive() const+0x32
        V [libjvm.so+0x95b620] ClassLoaderDataGraph::resize_if_needed()+0x1c0
        V [libjvm.so+0x162eac9] ParallelSPCleanupTask::work(unsigned int)+0x169
        V [libjvm.so+0x190bb30] GangWorker::loop()+0xe0
        V [libjvm.so+0x17bcce5] Thread::call_run()+0x75
        V [libjvm.so+0x14a7886] thread_native_entry(Thread*)+0x106

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                pliden Per Liden
                Reporter:
                pliden Per Liden
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: