apache/logging-log4net

Possible System.IndexOutOfRangeException in AppenderSkeleton.Finalize()

NicoCV opened this issue · 3 comments

We're using Log4Net (2.0.15.0-.NET 4.5) in WCF services hosted in IIS. On our production environments from time to times we're experiencing crash of the application pool with following error:

Exception: System.IndexOutOfRangeException

Message: Index was outside the bounds of the array.

StackTrace: at System.Collections.ArrayList.Add(Object value)
at log4net.Util.LogReceivedEventHandler.Invoke(Object source, LogReceivedEventArgs e)
at log4net.Util.LogLog.OnLogReceived(Type source, String prefix, String message, Exception exception)
at log4net.Util.LogLog.Debug(Type source, String message)
at log4net.Appender.AppenderSkeleton.Finalize()

So it seems the LogLog.Debug statement in the finalize method can fail in some circumstances...

@NicoCV can you test the code change from #135?

@FreeAndNil : First of all thanks for the really quick reaction and action! Unfortunatly it won't be possible for us to really test this. We've only seen this on production, and have not been able to simulate this on a non-production environment.

And we don't want to put an 'unofficial' version of the library on production.

@NicoCV I understand.
The official release for this issue will be 3.0.0 expected in 2 months.