[SERVER-2451] seg fault when cursor invalidated during explain yield Created: 01/Feb/11  Updated: 12/Jul/16  Resolved: 01/Feb/11

Status: Closed
Project: Core Server
Component/s: Concurrency
Affects Version/s: None
Fix Version/s: 1.7.6

Type: Bug Priority: Major - P3
Reporter: Aaron Staple Assignee: Aaron Staple
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

If we can't recover from a yield when explain is enabled, then inside finish() _c will be zero and we will seg fault in the call to noteScan(). I'll be checking in a test and can fix this too if you want - can we fix by asserting in this case? Otherwise it looks like we could grab the necessary info from the cursor in the beginning of running the query before any yielding happens.



 Comments   
Comment by auto [ 01/Feb/11 ]

Author:

{u'login': u'astaple', u'name': u'Aaron', u'email': u'aaron@10gen.com'}

Message: SERVER-2451 guard dropped cursor on explain yield
https://github.com/mongodb/mongo/commit/8330ff07664b1bbc1a966e5d224520872fbb245a

Comment by Eliot Horowitz (Inactive) [ 01/Feb/11 ]

Yes, asserting is fine.

Comment by Aaron Staple [ 01/Feb/11 ]

It's probably better if we just assert - the multikey flag of the index might change during a yield. And if we do lose the cursor part way though the results like n, nscanned, etc can be bogus anyway.

Comment by auto [ 01/Feb/11 ]

Author:

{u'login': u'astaple', u'name': u'Aaron', u'email': u'aaron@10gen.com'}

Message: SERVER-2451 test for seg fault when yielding during explain
https://github.com/mongodb/mongo/commit/c4c41d831e6b65f6e11f274cd65b149bc53c45aa

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