You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-dev@logging.apache.org by "Ron Grabowski (JIRA)" <ji...@apache.org> on 2008/08/23 21:17:44 UTC
[jira] Commented: (LOG4NET-167) ArrayOutOfBounds Exception in
MemoryAppender.getEvents()
[ https://issues.apache.org/jira/browse/LOG4NET-167?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12625091#action_12625091 ]
Ron Grabowski commented on LOG4NET-167:
---------------------------------------
It looks like elements can be added to the array while the Array.CopyTo is taking place which means the size/count could become out of bounds. This should fix it:
lock (m_eventsList.SyncRoot)
{
return (LoggingEvent[])m_eventsList.ToArray(typeof(LoggingEvent));
}
> ArrayOutOfBounds Exception in MemoryAppender.getEvents()
> --------------------------------------------------------
>
> Key: LOG4NET-167
> URL: https://issues.apache.org/jira/browse/LOG4NET-167
> Project: Log4net
> Issue Type: Bug
> Components: Appenders
> Affects Versions: 1.2.10
> Environment: Windows Vista and XP.
> Reporter: Kenny Clement
>
> Getting this every once in a while.
> No specific reproduction scenario.
> Destination array was not long enough. Check destIndex and length, and the array's lower bounds.
> at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)
> at System.Collections.ArrayList.ToArray(Type type)
> at log4net.Appender.MemoryAppender.GetEvents()
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.