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

Possible thread-safety bug in LoggingEvent

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.2.15
    • 2.0.6
    • Core
    • 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

            Unassigned Unassigned
            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