Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-18859

Logging before dynamic initializers have run in thread_name.cpp leaks memory

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.1.5
    • Affects Version/s: None
    • Component/s: Internal Code
    • Labels:
      None
    • Fully Compatible
    • ALL
    • Platform 5 06/26/16
    • 0

      If dynamic initialization for a global in a translation unit runs and invokes the logging subsystem before dynamic initialization has completed for the globals in src/mongo/util/concurrency/thread_name.cpp, then access to a zero-initialized boost::thread_specific_pointer variable will occur, resulting in undefined behavior.

      The observed behavior is that the program leaks a std::string, since it either isn't actually set, or is overwritten when the dynamic initializer for the thread_specific_pointer runs.

            Assignee:
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Reporter:
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: