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

Shenandoah: Resolve deadlock between OOM handler and nmethod lock

    Details

    • Subcomponent:
      gc
    • Resolved In Build:
      b27
    • CPU:
      generic
    • OS:
      generic

      Description

      JDK-8235337 changed OOM scoping, but unfortunately it causes a deadlock:


      Thread 20 (Thread 0x7f6119b86700 (LWP 190709)):
      #0 0x00007f61406baf55 in nanosleep () from /lib64/libpthread.so.0
      #1 0x00007f613f8caf9f in os::naked_short_nanosleep (ns=<optimized out>) at /home/rkennke/src/openjdk/jdk-jdk/src/hotspot/os/posix/os_posix.cpp:656
      #2 os::naked_short_sleep (ms=ms@entry=1) at /home/rkennke/src/openjdk/jdk-jdk/src/hotspot/os/posix/os_posix.cpp:662
      #3 0x00007f613fad4c6a in ShenandoahEvacOOMHandler::wait_for_no_evac_threads (this=this@entry=0x7f6138072a58) at /home/rkennke/src/openjdk/jdk-jdk/src/hotspot/share/gc/shenandoah/shenandoahEvacOOMHandler.cpp:42
      #4 0x00007f613fad5435 in ShenandoahEvacOOMHandler::handle_out_of_memory_during_evacuation (this=this@entry=0x7f6138072a58) at /home/rkennke/src/openjdk/jdk-jdk/src/hotspot/share/gc/shenandoah/shenandoahEvacOOMHandler.cpp:104
      #5 0x00007f613f85450b in ShenandoahHeap::evacuate_object (this=0x7f6138071a20, p=..., thread=0x7f61385ee000) at /home/rkennke/src/openjdk/jdk-jdk/src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp:279
      #6 0x00007f613fb22c44 in ShenandoahEvacuateUpdateRootsClosure::do_oop_work<oop> (p=0x7f6120e3aa26, this=<synthetic pointer>) at /home/rkennke/src/openjdk/jdk-jdk/src/hotspot/share/oops/oopsHierarchy.hpp:87
      #7 ShenandoahEvacuateUpdateRootsClosure::do_oop (p=0x7f6120e3aa26, this=<synthetic pointer>) at /home/rkennke/src/openjdk/jdk-jdk/src/hotspot/share/gc/shenandoah/shenandoahClosures.inline.hpp:130
      #8 ShenandoahNMethod::oops_do (fix_relocations=<optimized out>, oops=<optimized out>, this=<optimized out>) at /home/rkennke/src/openjdk/jdk-jdk/src/hotspot/share/gc/shenandoah/shenandoahNMethod.cpp:114
      #9 ShenandoahNMethod::heal_nmethod (nm=nm@entry=0x7f6120e23890) at /home/rkennke/src/openjdk/jdk-jdk/src/hotspot/share/gc/shenandoah/shenandoahNMethod.cpp:178
      #10 0x00007f613fa8e058 in ShenandoahBarrierSetNMethod::nmethod_entry_barrier (this=<optimized out>, nm=0x7f6120e23890) at /home/rkennke/src/openjdk/jdk-jdk/src/hotspot/share/gc/shenandoah/shenandoahBarrierSetNMethod.cpp:61
      #11 0x00007f613ea69f1b in BarrierSetNMethod::nmethod_stub_entry_barrier (return_address_ptr=0x7f6119b83928) at /home/rkennke/src/openjdk/jdk-jdk/src/hotspot/share/gc/shared/barrierSetNMethod.cpp:64
      #12 0x00007f6120753f3e in ?? ()
      #13 0x0000000000000000 in ?? ()

      Thread 10 (Thread 0x7f611a5fd700 (LWP 190698)):
      #0 0x00007f61406ba610 in __lll_lock_wait () from /lib64/libpthread.so.0
      #1 0x00007f61406b2f53 in pthread_mutex_lock () from /lib64/libpthread.so.0
      #2 0x00007f613fb11c94 in os::PlatformMutex::lock (this=0x7f60e93a7a98) at /home/rkennke/src/openjdk/jdk-jdk/src/hotspot/os/posix/os_posix.hpp:279
      #3 ShenandoahSimpleLock::lock (this=0x7f60e93a7a90) at /home/rkennke/src/openjdk/jdk-jdk/src/hotspot/share/gc/shenandoah/shenandoahLock.cpp:38
      #4 ShenandoahReentrantLock::lock (this=0x7f60e93a7a90) at /home/rkennke/src/openjdk/jdk-jdk/src/hotspot/share/gc/shenandoah/shenandoahLock.cpp:59
      #5 0x00007f613fa8f378 in ShenandoahReentrantLocker::ShenandoahReentrantLocker (lock=0x7f60e93a7a90, this=<synthetic pointer>) at /home/rkennke/src/openjdk/jdk-jdk/src/hotspot/share/gc/shenandoah/shenandoahLock.hpp:134
      #6 ShenandoahNMethodUnlinkClosure::do_nmethod (this=0x7f613c26f7c8, nm=0x7f6120e23890) at /home/rkennke/src/openjdk/jdk-jdk/src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.cpp:222
      #7 0x00007f613fb24594 in ShenandoahNMethodTableSnapshot::concurrent_nmethods_do (this=0x7f6110004400, cl=0x7f613c26f7c8) at /home/rkennke/src/openjdk/jdk-jdk/src/hotspot/share/gc/shenandoah/shenandoahNMethod.inline.hpp:33
      #8 0x00007f613fa8f259 in ShenandoahUnlinkTask::work (this=0x7f613c26f7b0, worker_id=<optimized out>) at /home/rkennke/src/openjdk/jdk-jdk/src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.cpp:263
      #9 0x00007f613fe40624 in GangWorker::run_task (this=this@entry=0x7f6110001000, data=...) at /home/rkennke/src/openjdk/jdk-jdk/src/hotspot/share/gc/shared/workgroup.cpp:332
      #10 0x00007f613fe4074e in GangWorker::loop (this=0x7f6110001000) at /home/rkennke/src/openjdk/jdk-jdk/src/hotspot/share/gc/shared/workgroup.cpp:342
      #11 0x00007f613fcff5c0 in Thread::call_run (this=this@entry=0x7f6110001000) at /home/rkennke/src/openjdk/jdk-jdk/src/hotspot/share/runtime/thread.cpp:399
      #12 0x00007f613f8be5e6 in thread_native_entry (thread=0x7f6110001000) at /home/rkennke/src/openjdk/jdk-jdk/src/hotspot/os/linux/os_linux.cpp:789
      #13 0x00007f61406b04e2 in start_thread () from /lib64/libpthread.so.0
      #14 0x00007f61405d8693 in clone () from /lib64/libc.so.6

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rkennke Roman Kennke
                Reporter:
                rkennke Roman Kennke
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: