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

StackOverflowError on exception during logging

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.14.1
    • None
    • SLF4J Bridge
    • None

    Description

      Sometimes we're getting the following logs:

      Exception in thread "ratpack-shutdown-thread" java.lang.StackOverflowError
          at org.apache.logging.log4j.spi.AbstractLogger.getRecursionDepthHolder(AbstractLogger.java:2166)
          at org.apache.logging.log4j.spi.AbstractLogger.decrementRecursionDepth(AbstractLogger.java:2178)
          at org.apache.logging.log4j.spi.AbstractLogger.logMessageTrackRecursion(AbstractLogger.java:2161)
          at org.apache.logging.log4j.spi.AbstractLogger.logMessageSafely(AbstractLogger.java:2142)
          at org.apache.logging.log4j.spi.AbstractLogger.logMessage(AbstractLogger.java:2017)
          at org.apache.logging.log4j.spi.AbstractLogger.logIfEnabled(AbstractLogger.java:1983)
          at org.apache.logging.log4j.spi.AbstractLogger.warn(AbstractLogger.java:2676)
          at org.apache.logging.log4j.spi.AbstractLogger.handleLogMessageException(AbstractLogger.java:2235)
          at org.apache.logging.log4j.spi.AbstractLogger.tryLogMessage(AbstractLogger.java:2208)
      ...

      and

       Exception in thread "ratpack-shutdown-thread" java.lang.OutOfMemoryError: Java heap space
              at java.util.Arrays.copyOf(Unknown Source)
              at java.lang.AbstractStringBuilder.ensureCapacityInternal(Unknown Source)
              at java.lang.AbstractStringBuilder.append(Unknown Source)
              at java.lang.StringBuilder.append(Unknown Source)
              at org.apache.logging.log4j.spi.AbstractLogger.handleLogMessageException(AbstractLogger.java:2234)
              at org.apache.logging.log4j.spi.AbstractLogger.tryLogMessage(AbstractLogger.java:2208)
              at org.apache.logging.log4j.spi.AbstractLogger.logMessageTrackRecursion(AbstractLogger.java:2159)
              at org.apache.logging.log4j.spi.AbstractLogger.logMessageSafely(AbstractLogger.java:2142)
              at org.apache.logging.log4j.spi.AbstractLogger.logMessage(AbstractLogger.java:2017)
              at org.apache.logging.log4j.spi.AbstractLogger.logIfEnabled(AbstractLogger.java:1983)
              at org.apache.logging.log4j.spi.AbstractLogger.warn(AbstractLogger.java:2676)
              at org.apache.logging.log4j.spi.AbstractLogger.handleLogMessageException(AbstractLogger.java:2235)
      

      We suspect it's an infinite loop caused by throwing an exception why another exception is being handled.

      Upgrading from 2.14.0 to 2.14.1 didn't help. 

      Attachments

        Activity

          People

            Unassigned Unassigned
            paplorinc Lőrinc Pap
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: