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

Object monitor deadlock with no threads holding the monitor (using jemalloc 5.1)

    Details

      Description

      ADDITIONAL SYSTEM INFORMATION :
      We've tested on the following operating systems: Debian 8 and 9, and Ubuntu 16.04.
      And these OpenJDK JVM runtimes: multiple versions of 1.8 between 1.8.0.121 and 1.8.0.202, 1.9, and 1.11.

      A DESCRIPTION OF THE PROBLEM :
      We've run into an issue where our application deadlocks, and when looking at thread dumps we see that threads are waiting for an object monitor that no other thread is currently holding. The thread that the monitor references is parked in a threadpool waiting for its next task.

      Test application - https://github.com/djscholl/jemalloc-java-deadlock
      Example log output when a deadlock occurred - https://gist.github.com/djscholl/413071ef29671fb53b5a64e105421f1a

      See https://github.com/jemalloc/jemalloc/issues/1392 for a more detailed description.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      https://github.com/djscholl/jemalloc-java-deadlock is a test application. There is a README with instructions.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The application should finish all iterations and not exit the loop early.
      ACTUAL -
      The application exits the loop early because of a timeout caused by the deadlock.

      ---------- BEGIN SOURCE ----------
      https://github.com/djscholl/jemalloc-java-deadlock
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      So far we've worked around this by not upgrading to jemalloc 5.1. jemalloc 4.5 does not seem to cause the problem. Also glibc malloc does not seem to have the problem.

      FREQUENCY : occasionally


        Attachments

        1. gdb-threads-bt.log
          586 kB
        2. jemallock.log
          623 kB
        3. log_jstack_output
          622 kB
        4. log_threadstack
          1.83 MB
        5. log_threadstack2
          965 kB

          Issue Links

            Activity

              People

              • Assignee:
                fmatte Fairoz Matte
                Reporter:
                webbuggrp Webbug Group
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated: