[SERVER-16954] Removing objects from under a geo $near query causes invalid memory access Created: 20/Jan/15  Updated: 23/Jan/15  Resolved: 22/Jan/15

Status: Closed
Project: Core Server
Component/s: Geo, Querying
Affects Version/s: 2.8.0-rc5
Fix Version/s: 3.0.0-rc6

Type: Bug Priority: Major - P3
Reporter: Charlie Swanson Assignee: David Storch
Resolution: Done Votes: 0
Labels: 28qa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File mongod.log    
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

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();

Participants:

 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.



 Comments   
Comment by Githook User [ 22/Jan/15 ]

Author:

{u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}

Message: SERVER-16954 fix invalidation handling in NearStage
Branch: master
https://github.com/mongodb/mongo/commit/871ed2eec7a1bf2bed5bc8fc5f04a3eaa99d3fbd

Generated at Thu Feb 08 03:42:49 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.