[ 
https://issues.apache.org/jira/browse/QPID-7955?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16195704#comment-16195704
 ] 

Keith Wall commented on QPID-7955:
----------------------------------

This defect has been possible ever since the Java Broker switched to Logback 
from Log4J and started supporting Java 7.  Any Java Broker code producing such 
exceptions or dependent libraries would fail in the same way. (Logback 1.0.1[1] 
introduced support for Java 7 suppressed exceptions).

The best solution would be an upgrade to a newer release of Logback which 
guarded against suppressed exception chains containing circular references.  
However, LOGBCK-1027 is tagged for Logback 1.3 and I don't see a proposed 
release date on the site.  

As this defect disguises the underlying cause of the exception, a Java Broker 
would be difficult to support in its current state.  A workaround is required 
until  new version of Logback is available.

The best option I see is to utilise the Logback TurboFilter to replace logging 
calls with a recursive throwables with a replacement.  The turbo filter would 
need to, if the log call had a throwable, check if the throwable's 
chain/suppressed exceptions were recursive.  As turbo filters cannot affect the 
arguments of the original logging call, it will then dispatch a second logging 
call to the same logger with same message/args but without the offending 
throwable,.  The message would be augmented with a string generated from 
{{Throwable#printStackTrace()}} (which defends against recursion).  The 
original logging call would ended by returning a Filter.DENIED.   We can 
short-circuit the algorithm by testing if the logging call is eligible 
ourselves (i.e. Logger.effectiveLevelInt <= Level.levelInt) and avoid the 
traversal of the exceptions if no.

I have not tested this approach.

[1] https://logback.qos.ch/news.html


 

> Logback Stack overflow exception whilst reporting fatal BDB JE error
> --------------------------------------------------------------------
>
>                 Key: QPID-7955
>                 URL: https://issues.apache.org/jira/browse/QPID-7955
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Broker
>    Affects Versions: qpid-java-broker-7.0.0
>            Reporter: Keith Wall
>
> Running a test case that deliberately causes the Broker configured to use BDB 
> to run out of diskspace, the Broker shuts down with the following exception.  
> The exception exception was IOException reporting the absence of diskspace.   
> Problem occurs equally on all three AMQP protocols.
> {code}
> java.lang.StackOverflowError: null
>         at 
> com.sleepycat.je.DatabaseException.getMessage(DatabaseException.java:156)
>         at 
> com.sleepycat.je.EnvironmentFailureException.getMessage(EnvironmentFailureException.java:255)
>         at 
> ch.qos.logback.classic.spi.ThrowableProxy.<init>(ThrowableProxy.java:54)
>         at 
> ch.qos.logback.classic.spi.ThrowableProxy.<init>(ThrowableProxy.java:60)
>         at 
> ch.qos.logback.classic.spi.ThrowableProxy.<init>(ThrowableProxy.java:72)
>         at 
> ch.qos.logback.classic.spi.ThrowableProxy.<init>(ThrowableProxy.java:60)
>         at 
> ch.qos.logback.classic.spi.ThrowableProxy.<init>(ThrowableProxy.java:72)
>         at 
> ch.qos.logback.classic.spi.ThrowableProxy.<init>(ThrowableProxy.java:60)
>         at 
> ch.qos.logback.classic.spi.ThrowableProxy.<init>(ThrowableProxy.java:72)
>         at 
> ch.qos.logback.classic.spi.ThrowableProxy.<init>(ThrowableProxy.java:60)
>         at 
> ch.qos.logback.classic.spi.ThrowableProxy.<init>(ThrowableProxy.java:72)
>         at 
> ch.qos.logback.classic.spi.ThrowableProxy.<init>(ThrowableProxy.java:60)
>         at 
> ch.qos.logback.classic.spi.ThrowableProxy.<init>(ThrowableProxy.java:72)
>         at 
> ch.qos.logback.classic.spi.ThrowableProxy.<init>(ThrowableProxy.java:60)
>         at 
> ch.qos.logback.classic.spi.ThrowableProxy.<init>(ThrowableProxy.java:72)
>         at 
> ch.qos.logback.classic.spi.ThrowableProxy.<init>(ThrowableProxy.java:60)
>         at 
> ch.qos.logback.classic.spi.ThrowableProxy.<init>(ThrowableProxy.java:72)
>         at 
> ch.qos.logback.classic.spi.ThrowableProxy.<init>(ThrowableProxy.java:60)
>         at 
> ch.qos.logback.classic.spi.ThrowableProxy.<init>(ThrowableProxy.java:72)
>         at 
> ch.qos.logback.classic.spi.ThrowableProxy.<init>(ThrowableProxy.java:60)
>         at 
> ch.qos.logback.classic.spi.ThrowableProxy.<init>(ThrowableProxy.java:72)
>         at 
> ch.qos.logback.classic.spi.ThrowableProxy.<init>(ThrowableProxy.java:60)
>         at 
> ch.qos.logback.classic.spi.ThrowableProxy.<init>(ThrowableProxy.java:72)
>         at 
> ch.qos.logback.classic.spi.ThrowableProxy.<init>(ThrowableProxy.java:60)
>         at 
> ch.qos.logback.classic.spi.ThrowableProxy.<init>(ThrowableProxy.java:72)
>         at 
> ch.qos.logback.classic.spi.ThrowableProxy.<init>(ThrowableProxy.java:60)
>         at 
> ch.qos.logback.classic.spi.ThrowableProxy.<init>(ThrowableProxy.java:72)
>         at 
> ch.qos.logback.classic.spi.ThrowableProxy.<init>(ThrowableProxy.java:60)
>         at 
> ch.qos.logback.classic.spi.ThrowableProxy.<init>(ThrowableProxy.java:72)
>         at 
> ch.qos.logback.classic.spi.ThrowableProxy.<init>(ThrowableProxy.java:60)
>         at 
> ch.qos.logback.classic.spi.ThrowableProxy.<init>(ThrowableProxy.java:72)
>         at 
> ch.qos.logback.classic.spi.ThrowableProxy.<init>(ThrowableProxy.java:60)
>         at 
> ch.qos.logback.classic.spi.ThrowableProxy.<init>(ThrowableProxy.java:72)
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org

Reply via email to