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

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

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 3.1.5
    • None
    • Internal Code
    • None
    • Fully Compatible
    • ALL
    • Platform 5 06/26/16
    • 0

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: