I've just ran into this or something similar with
throwable.getSuppressed()[0].getCause() == throwable.
Sure, such a cycle is a bug itself, but how am I supposed to fix it, when all I get is
java.lang.StackOverflowError: null
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at ch.qos.logback.classic.spi.ThrowableProxy.<init>(ThrowableProxy.java:66)
at ch.qos.logback.classic.spi.ThrowableProxy.<init>(ThrowableProxy.java:60)
at ch.qos.logback.classic.spi.ThrowableProxy.<init>(ThrowableProxy.java:60)
at ch.qos.logback.classic.spi.ThrowableProxy.<init>(ThrowableProxy.java:60)
at ch.qos.logback.classic.spi.ThrowableProxy.<init>(ThrowableProxy.java:72)
with the last two lines repeated again and again?
To be constructive: It'd be nice if logback would not only detect such a situation, but also print some information like
throwable.getSuppressed()[0].getSuppressed()[0] == throwable
for the originally reported case or
throwable.getSuppressed()[0].getCause() == throwable
for my case. It may be helpful sometimes.
While I know the cycle and can reproduce the problem, I still have no idea how it actually happens.
Regards, Martin.