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

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 2.8.0-rc5
    • 3.0.0-rc6
    • Geo, Querying
    • Fully Compatible
    • ALL
    • 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

            david.storch@mongodb.com David Storch
            charlie.swanson@mongodb.com Charlie Swanson
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: