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

WhereMatchExpression::shallowClone can leak memory during interruption

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 3.1.4
    • 3.1.5
    • Querying
    • Fully Compatible
    • ALL
    • Sharding 5 06/26/16
    • 0

    Description

      WhereMatchExpression::shallowClone allocates a new javascript scope object and re-parses the javascript from the original WhereMatchExpression. Because the parsing involves entering the javascript engine, it may throw an exception to indicate that the operation has been interrupted. When this happens, the new match expression is leaked.

      It is not sufficient to delete the new expression and propagate the exception, because if the where expression object is a subexpression (say of an "or" expression), the bubbling exception will cause the parent to be leaked. That is to say, shallowClone on match expressions is not exception safe.

      Attachments

        Issue Links

          Activity

            People

              schwerin@mongodb.com Andy Schwerin
              schwerin@mongodb.com Andy Schwerin
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: