[SERVER-18068] Coverity analysis defect 72413: Resource leak Created: 15/Apr/15  Updated: 27/Jul/15  Resolved: 01/Jul/15

Status: Closed
Project: Core Server
Component/s: Testing Infrastructure
Affects Version/s: None
Fix Version/s: 2.6.11, 3.0.5

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Qingyang Chen
Resolution: Done Votes: 0
Labels: coverity
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-16889 Query subsystem public API should use... Closed
Related
related to SERVER-18063 Coverity analysis defect 72409: Resou... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Completed:
Sprint: Quint Iteration 5, Quint Iteration 6
Participants:

 Description   

A new defect has been detected and assigned to charlie.swanson in Coverity Connect.
http://coverity.mongodb.com//sourcebrowser.htm?projectId=10001#mergedDefectId=72413
The defect was flagged by checker RESOURCE_LEAK in
file /src/mongo/db/query/query_planner.cpp
function mongo::QueryPlanner::planFromCache(const mongo::CanonicalQuery &, const mongo::QueryPlannerParams &, const mongo::CachedSolution &, mongo::QuerySolution **)
and this ticket was created by charlie.swanson



 Comments   
Comment by Ramon Fernandez Marina [ 02/Jul/15 ]

Fix and backport were accidentally sent to SERVER-18086:

Author:
{u'username': u'coollog', u'name': u'Qingyang Chen', u'email': u'qingyang.chen@10gen.com'}
Message: SERVER-18086 fix leak in QueryPlanner::planFromCache
Branch: v3.0
https://github.com/mongodb/mongo/commit/db0ba62bd4a375f86e36c992033894569233000f

Author:
{u'username': u'coollog', u'name': u'Qingyang Chen', u'email': u'qingyang.chen@10gen.com'}
Message: SERVER-18086 fix leak in QueryPlanner::planFromCache
Branch: v2.6
https://github.com/mongodb/mongo/commit/16d594b5d2ca3ee0466513eb5d392d0e59084dac

Comment by J Rassi [ 29/Jun/15 ]

This has been fixed by SERVER-16889 in 3.1.5. Linking 16889 as duplicate, and resolving this ticket as "Fixed".

Q, would you please prepare a targeted backport against the v3.0 branch for this leak?

Comment by J Rassi [ 15/Apr/15 ]

Yep, this is legit leak on one of the error paths of QueryPlanner::planFromCache(). However, this wasn't introduced by recent work on CachedPlanStage; this is a regression introduced in 2.5.5 by SERVER-10564 (81a1f70b). It seems difficult to hit on first glance, but I haven't investigated fully. Parking it in my 3.1.3 queue for now, and requesting v2.6 / v3.0 backports.

Thanks, Charlie.

Comment by Charlie Swanson [ 15/Apr/15 ]

This seems related to the work on the CachePlanStage:
https://github.com/mongodb/mongo/commit/81a1f70b87b3f3754931829b11faa0a53df64527

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