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

Change StringDedup thread to derive from JavaThread

XMLWordPrintable

    • gc
    • b21
    • x86_64
    • linux
    • Not verified

      [As discussed in comments, ZGC doesn't expect non-JavaThreads to execute load barriers. The StringDedup thread being a ConcurrentGCThread runs afoul of this, resulting in the described crash.]

      The following test failed in the JDK21 CI:

      gc/stringdedup/TestStringDeduplicationFullGC.java#Z

      Here's a snippet from the log file:

      [0.938s][info ][gc,heap ] GC(0) Garbage: - 4M (4%) 4M (4%) 2M (2%) - -
      [0.938s][info ][gc,heap ] GC(0) Reclaimed: - - 0M (0%) 1M (2%) - -
      [0.938s][info ][gc ] GC(0) Garbage Collection (System.gc()) 6M(6%)->6M(6%)
      End: Full GC 1/3
      Creating strings: total=10, unique=10
      Begin: Full GC 2/3
      [0.941s][info ][gc,start ] GC(1) Garbage Collection (System.gc())
      [0.941s][info ][gc,task ] GC(1) Using 1 workers
      [0.942s][info ][gc,phases ] GC(1) Pause Mark Start 0.016ms
      [0.954s][debug][stringdedup,phases ] Process paused
      [0.954s][debug][stringdedup,phases,start] Resize Table: 503 -> 1009 (7043)
      [0.957s][debug][stringdedup,phases ] Resize Table end: 3.009ms
      [0.957s][debug][stringdedup,phases ] Process resume
      [0.974s][info ][gc,phases ] GC(1) Concurrent Mark 32.457ms
      [1.047s][info ][gc,phases ] GC(1) Pause Mark End 71.251ms
      [1.047s][info ][gc,phases ] GC(1) Concurrent Mark Free 0.004ms
      [1.061s][info ][gc,phases ] GC(1) Concurrent Process Non-Strong References 13.737ms
      [1.061s][info ][gc,phases ] GC(1) Concurrent Reset Relocation Set 0.001ms
      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # SIGSEGV (0xb) at pc=0x00007f62ae56f8a8, pid=2737741, tid=2737799
      #
      # JRE version: Java(TM) SE Runtime Environment (21.0+17) (fastdebug build 21-ea+17-LTS-1389)
      # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 21-ea+17-LTS-1389, mixed mode, sharing, tiered, compressed class ptrs, z gc, linux-amd64)
      # Problematic frame:
      # V [libjvm.so+0x18a68a8] ZBarrier::weak_load_barrier_on_phantom_oop_slow_path(unsigned long)+0x108
      #
      # Core dump will be written. Default location: Core dumps may be processed with "/opt/core.sh %p" (or dumping to /opt/mach5/mesos/work_dir/slaves/741e9afd-8c02-45c3-b2e2-9db1450d0832-S40887/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/5f625517-5f22-40b0-b043-1a08f2001475/runs/a55f33e6-6f08-4389-b859-d0c6c6fecd6b/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier1_gc/scratch/5/core.2737741)
      #
      # An error report file with more information is saved as:
      # /opt/mach5/mesos/work_dir/slaves/741e9afd-8c02-45c3-b2e2-9db1450d0832-S40887/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/5f625517-5f22-40b0-b043-1a08f2001475/runs/a55f33e6-6f08-4389-b859-d0c6c6fecd6b/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier1_gc/scratch/5/hs_err_pid2737741.log
      #
      # If you would like to submit a bug report, please visit:
      # https://bugreport.java.com/bugreport/crash.jsp
      #

      [2023-04-04T13:08:54.929696596Z] Waiting for completion for process 2737741
      [2023-04-04T13:08:54.929875235Z] Waiting for completion finished for process 2737741
      [2023-04-04T13:08:54.929926542Z] Waiting for completion for process 2737741
      [2023-04-04T13:08:54.930043654Z] Waiting for completion finished for process 2737741
      [2023-04-04T13:08:54.952614699Z] Waiting for completion for process 2737741
      [2023-04-04T13:08:54.952852250Z] Waiting for completion finished for process 2737741
      ----------System.err:(144/11150)----------


      Here's the crashing thread's stack:

      --------------- T H R E A D ---------------

      Current thread (0x00007f62a813aaf0): ConcurrentGCThread "StringDedupProcessor" [stack: 0x00007f62904cc000,0x00007f62905cc000] [id=2737799]

      Stack: [0x00007f62904cc000,0x00007f62905cc000], sp=0x00007f62905caa00, free space=1018k
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.so+0x18a68a8] ZBarrier::weak_load_barrier_on_phantom_oop_slow_path(unsigned long)+0x108 (zPage.inline.hpp:192)
      V [libjvm.so+0x89ef0e] AccessInternal::PostRuntimeDispatch<ZBarrierSet::AccessBarrier<598084ul, ZBarrierSet>, (AccessInternal::BarrierType)2, 598084ul>::oop_access_barrier(void*)+0x23e (zBarrier.inline.hpp:151)
      V [libjvm.so+0x162dd49] StringDedup::Processor::process_requests(SuspendibleThreadSetJoiner*) const+0x1c9 (accessBackend.hpp:479)
      V [libjvm.so+0x162eb83] StringDedup::Processor::run_service()+0x83 (stringDedupProcessor.cpp:201)
      V [libjvm.so+0x9f643b] ConcurrentGCThread::run()+0x1b (concurrentGCThread.cpp:48)
      V [libjvm.so+0x1766498] Thread::call_run()+0xb8 (thread.cpp:224)
      V [libjvm.so+0x14695ea] thread_native_entry(Thread*)+0x11a (os_linux.cpp:740)

      siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x0000000000000004

            kbarrett Kim Barrett
            dcubed Daniel Daugherty
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: