[SERVER-40037] Take a shared_ptr to Trackers in IndexBuildsCoordinator before calling waitUntilNoIndexBuildsRemain Created: 08/Mar/19  Updated: 29/Oct/23  Resolved: 08/Mar/19

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: None
Fix Version/s: 4.1.9

Type: Bug Priority: Major - P3
Reporter: Dianna Hohensee (Inactive) Assignee: Dianna Hohensee (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Storage NYC 2019-03-11
Participants:
Linked BF Score: 83

 Description   

We have memory errors in the IndexBuildsCoordinator's use of the CollectionIndexBuildsTracker and DatabaseIndexBuildsTracker objects where we call waitUntilNoIndexBuildsRemain through hash map iterators rather than acquiring a safe shared_ptr to call wait upon, leading to a use after free when the entry is removed from the hash map and the caller of waitUntilNoIndexBuildsRemain does not have a shared_ptr instance to keep the object in memory.



 Comments   
Comment by Githook User [ 08/Mar/19 ]

Author:

{'name': 'Dianna Hohensee', 'email': 'dianna.hohensee@10gen.com', 'username': 'DiannaHohensee'}

Message: SERVER-40037 Take a shared_ptr to Trackers in IndexBuildsCoordinator before calling waitUntilNoIndexBuildsRemain
Branch: master
https://github.com/mongodb/mongo/commit/53ac5d900c2f4352565ae2896e4b8d9ae6fe29be

Generated at Thu Feb 08 04:53:51 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.