Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-1457

Class loader deadlock when using async logging and extended stack trace pattern

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.6.1
    • Fix Version/s: 2.7
    • Component/s: None
    • Labels:
      None
    • Environment:

      On CentOS 6.7 and Java 1.8.0_60.

    • Flags:
      Important

      Description

      We've encountered a class loading deadlock. Please review attached thread dump. Is it possible to have an option of pre-initializing the exception's thread stack on the caller's thread? It's hard to predict what libraries are doing in their classes' static initializers and may eventually end up logging and causing deadlock.

      In the attached thread dump here are the threads of interest:
      "Log4j2-AsyncLogger[AsyncContext@18b4aac2]1" #16 daemon prio=5 os_prio=0 tid=0x00007ff870c7b000 nid=0x79f3 in Object.wait() [0x00007ff839142000]
      java.lang.Thread.State: RUNNABLE
      at java.lang.Class.forName0(Native Method)
      ...
      and
      "1A03340:Company:japan" #568 prio=5 os_prio=0 tid=0x00007ff871677000 nid=0x725 runnable [0x00007ff74bd27000]
      ...<clinit>...

        Attachments

        1. LOG4J2-1457.patch
          8 kB
          Leon Finker
        2. threaddump.txt
          814 kB
          Leon Finker

          Activity

            People

            • Assignee:
              jvz Matt Sicker
              Reporter:
              leonfin Leon Finker
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: