Core Server
  1. Core Server
  2. SERVER-2520

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

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Minor - P4 Minor - P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.9.1
    • Component/s: Replication/Pairing
    • Labels:
      None
    • Backport:
      No
    • Operating System:
      ALL
    • Bug Type:
      Memory Leak
    • # Replies:
      4
    • Last comment by Customer:
      false

      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 Merriman
        added a comment -

        was intentional

        Show
        Dwight Merriman
        added a comment - was intentional
        Hide
        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 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 Merriman
        added a comment -

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

        Show
        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
        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
        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:
              2 years, 51 weeks, 3 days ago
              Date of 1st Reply: