logging-log4net-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Bodewig (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (LOG4NET-462) ReadOnlyPropertiesDictionary not thread safe
Date Fri, 13 Nov 2015 21:03:11 GMT

     [ https://issues.apache.org/jira/browse/LOG4NET-462?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Stefan Bodewig updated LOG4NET-462:
-----------------------------------
    Fix Version/s: 1.2.15

> ReadOnlyPropertiesDictionary not thread safe
> --------------------------------------------
>
>                 Key: LOG4NET-462
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-462
>             Project: Log4net
>          Issue Type: Bug
>    Affects Versions: 1.2.13
>            Reporter: Tom Tutko
>            Priority: Blocker
>              Labels: thread-safety
>             Fix For: 1.2.15, 1.3.0
>
>
> I have an application that runs as a windows service and spins up multiple AppDomains,
each with their own loggers. I will often run into an issue where log4net appears to be causing
one or more of the spun up AppDomains to not function properly. The relevant stack trace looks
as follows:
> System.InvalidOperationException: Collection was modified; enumeration operation may
not execute.
>   at System.Collections.Hashtable.HashtableEnumerator.MoveNext()
>   at log4net.Util.ReadOnlyPropertiesDictionary.GetObjectData(Serialization info, StreamingContext
context)
>   at System.Runtime.Serialization.ObjectCloneHelper.GetObjectData(Object serObj, String&amp;
typeName, String&amp; assemName, String[]&amp; fieldNames, Object[]&amp; fieldValues)
> I have not been able to find the specific conditions to reproduce this but it happens
often enough to be a huge problem. Looking at the log4net source, the ReadOnlyPropertiesDictionary.GetObjectData()
method does a foreach over the InnerHashTable collection but there is nothing to stop that
collection from being modified outside of that loop which is leading to the exception. I am
not sure where in my code I would be doing anything that modified that collection indirectly
but I do know that I push several things on and off of the LogicalThreadContext.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message