Uploaded image for project: 'Log4cxx'
  1. Log4cxx
  2. LOGCXX-411

Crash when logging on multiple threads.

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      The following code extract causes a crash within a multi threaded environment
      LevelPtr Level::getFatal() {
      static LevelPtr level(new Level(Level::FATAL_INT, LOG4CXX_STR("FATAL"), 0));
      return Fatallevel;
      }

      File level.cpp file. If two threads call this simultaneously or any of the other Level::getXXXX functions, the second thread may get a null pointer returned if the first thread is still constructing the static LevelPtr level object.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                carnold@apache.org Curt Arnold
                Reporter:
                peterxgould Peter Gould
              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: