Uploaded image for project: 'Log4net'
  1. Log4net
  2. LOG4NET-529

Possible thread-safety bug in LoggingEvent

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.2.15
    • Fix Version/s: 2.0.6
    • Component/s: Core
    • Labels:
      None

      Description

      From imspecting the code there appears to be a race condition if two threads call LoggingEvent.LookupProperty concurrently. One thread may call CreateCompositeProperties and the other might access m_compositeProperties before it is fully created.

      public object LookupProperty(string key)
      {
      if (m_data.Properties != null)

      { return m_data.Properties[key]; }

      if (m_compositeProperties == null)

      { CreateCompositeProperties(); }

      return m_compositeProperties[key];
      }

      private void CreateCompositeProperties()
      {
      m_compositeProperties = new CompositeProperties();

      if (m_eventProperties != null)

      { m_compositeProperties.Add(m_eventProperties); }

      ... etc

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              JoeJoe Joe
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 24h
                24h
                Remaining:
                Remaining Estimate - 24h
                24h
                Logged:
                Time Spent - Not Specified
                Not Specified