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

CanonicalQuery::canonicalize can leak a LiteParsedQuery

    XMLWordPrintable

    Details

    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Completed:
    • Steps To Reproduce:
      Hide

      Run mongod under a leak detector, and run jstests/core/geo_s2near.js. The last line of that test, which tests a fix for SERVER-13666, issues out-of-bounds legacy coordinates to a spherical near query. This causes uassert 17444 to trigger, raising an exception and leaking the LiteParsedQuery.

      Show
      Run mongod under a leak detector, and run jstests/core/geo_s2near.js. The last line of that test, which tests a fix for SERVER-13666 , issues out-of-bounds legacy coordinates to a spherical near query. This causes uassert 17444 to trigger, raising an exception and leaking the LiteParsedQuery.

      Description

      If MatchExpressionParser::parse in the 13 argument form of CanonicalQuery::canonicalize throws an exception (as can occur, for instance, at uassert 17444 in expression_geo.cpp,) then the LiteParsedQuery object returned from LiteParsedQuery::make will be leaked since it is not wrapped in an owning smart pointer.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: