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

add comments in code about intentional memory leak in ReplSetImpl::initFromConfig()

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.9.1
    • Component/s: Replication/Pairing
    • Labels:
      None
    • Operating System:
      ALL

      Description

      A "new Member" allocated in this function may be leaked according to valgrind. Quick look through the code suggests that this function can be called multiple times (in one particular case if we are reconfiguring a repl set) and don't see immediately that they are cleaned up.

      It looks like the members in _members and _self can be leaked.

      It also appears that the _members values are leaked intentionally.

        Activity

        Hide
        dwight_10gen Dwight Merriman added a comment -

        was intentional

        Show
        dwight_10gen Dwight Merriman added a comment - was intentional
        Hide
        aaron Aaron Staple (Inactive) added a comment -

        There is another leak in this function I didn't address earlier - the _cfg variable is leaked. Not sure if that one's intentional or not. Might be nice to comment when there are intentional leaks.

        Show
        aaron Aaron Staple (Inactive) added a comment - There is another leak in this function I didn't address earlier - the _cfg variable is leaked. Not sure if that one's intentional or not. Might be nice to comment when there are intentional leaks.
        Hide
        dwight_10gen Dwight Merriman added a comment -

        i think was intentional, as it's a concurrency thing that there could be latent readers of it.

        Show
        dwight_10gen Dwight Merriman added a comment - i think was intentional, as it's a concurrency thing that there could be latent readers of it.
        Hide
        auto auto (Inactive) added a comment -

        Author:

        {u'login': u'kchodorow', u'name': u'Kristina', u'email': u'kristina@10gen.com'}

        Message: add comment about memory leaks SERVER-2520
        Branch: master
        https://github.com/mongodb/mongo/commit/210d9599c32c0819ae7a7715e146c2c27f603623

        Show
        auto auto (Inactive) added a comment - Author: {u'login': u'kchodorow', u'name': u'Kristina', u'email': u'kristina@10gen.com'} Message: add comment about memory leaks SERVER-2520 Branch: master https://github.com/mongodb/mongo/commit/210d9599c32c0819ae7a7715e146c2c27f603623

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Days since reply:
              3 years, 47 weeks, 4 days ago
              Date of 1st Reply: