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

Removing objects from under a geo $near query causes invalid memory access

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.8.0-rc5
    • Fix Version/s: 3.0.0-rc6
    • Component/s: Geo, Querying
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

      t = db.geo_near
      t.drop();
       
      for (var x = -1; x < 1; x += 1) {
          for (var y = -1; y < 1; y += 1) {
              t.insert({geo: [x, y]})
          }
      }
       
      t.ensureIndex({ geo : "2d" })
       
      var cur = t.find({geo: {$near: [0,0], $maxDistance: 3}}).batchSize(2);
      cur.next();
      cur.next();
      t.remove({})
      cur.next();

      Show
      t = db.geo_near t.drop();   for (var x = -1; x < 1; x += 1) { for (var y = -1; y < 1; y += 1) { t.insert({geo: [x, y]}) } }   t.ensureIndex({ geo : "2d" })   var cur = t.find({geo: {$near: [0,0], $maxDistance: 3}}).batchSize(2); cur.next(); cur.next(); t.remove({}) cur.next();

      Description

      It seems like the GEO_NEAR_2D stage fails to realize when an object is removed from under it, see repro below. This only causes a failure on an MMAPV1 Node, no issues on a wiredTiger node, or a 2.6.6 node. Log attached.

        Attachments

          Activity

            People

            Assignee:
            david.storch David Storch
            Reporter:
            charlie.swanson Charlie Swanson
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: