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

Memory Leak in dbtests/perftests.cpp

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.1.0
    • Affects Version/s: None
    • Component/s: Testing Infrastructure
    • Labels:
      None
    • ALL

      Issue based on post on GG

      Sentry found a couple new memory leaks today, introduced here:
      https://github.com/mongodb/mongo/commit/7c8cfd9
      I know it's test code, but someone may be interested in cleaning it up anyway. In dbtests/perftests.cpp, around line 180:
      DBClientConnection *c = new DBClientConnection(false, 0, 10);
      string err;
      if( c->connect("mongo05.10gen.cust.cbici.net", err) ) {
      if( !c->auth("perf", "perf", pwd, err) )

      { cout << "info: authentication with stats db failed: " << err << endl; // XXX: c leaked on this path assert(false); }


      conn = c;
      }
      else

      { cout << err << " (to log perfstats)" << endl; // XXX: c leaked on this path }


      I've noted the two locations where the connection 'c' is leaked in the above code (goes out of scope without being reassigned or deleted). Again, not a big deal if these are short-lived tests, but worth fixing if the tests are resource intensive.

            Assignee:
            matulef Kevin Matulef
            Reporter:
            sridhar Sridhar Nanjundeswaran
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: