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

global 'ports' variable is not used in a thread safe manner

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 0.9.4
    • Affects Version/s: None
    • Component/s: Stability
    • None

      Whenever we create a new MessagingPort, its address gets added to a global ports object. We may create MessagingPort objects in Listener::listen() or in DBClientConnection::connect(), and the db mutex need not be held in either context. It looks like the MessagingPort objects created by Listener are never destroyed, but the ones created by DBClientConnection get destroyed when the connection is destroyed. On destruction MessagingPort objects are removed from the 'ports' set, and this isn't done in a thread safe manner either.

      Resulted in a seg fault here:
      <http://buildbot.mongodb.org/builders/OS%20X%2010.5%2032-bit/builds/372/steps/test_3/logs/stdio>

            Assignee:
            dwight@mongodb.com Dwight Merriman
            Reporter:
            aaron Aaron Staple
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: