Actions
Bug #54354
opendbstore: DB::objectmap leaks memory and is not thread-safe between DB instances
% Done:
0%
Source:
Tags:
dbstore
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):
Description
what exactly is objectmap for? it only seems to be used for SQLiteDB::ListAllObjects() as a way to know which buckets to enumerate. but objectmap only caches the buckets that have been accessed since startup. why do we need a cache of buckets, instead of just traversing the 'buckets' table?
objectmap uses `std::map<std::string, ObjectOp*>` with raw (non-owning) pointers to ObjectOp instead of unique_ptr
objectmapDelete() does not free the ObjectOp. even if it did, SQLiteDB::ListAllObjects() makes a copy of the entire objectmap, so might try to read ObjectOps after they're freed
objectmap is a static variable, but the mutex protecting it is not static. this means objectmap is not thread-safe between instances of DB
Actions