Details
Description
The ep-engine_kvstore_test unit test, when run under Valgrind reports a number of memory leaks. I've briefly looked into these and they only appear when the forestdb variant runs.
There are a number of leaks, the biggest of which looks like the block cache not getting freed:
==842== 134,217,728 bytes in 1 blocks are still reachable in loss record 20 of 20
|
==842== at 0x7BBC6DC: je_malloc (jemalloc.c:1441)
|
==842== by 0x5693D8C: bcache_init (blockcache.cc:1390)
|
==842== by 0x56AB5AB: filemgr_init (filemgr.cc:226)
|
==842== by 0x56B5FFA: fdb_init (forestdb.cc:681)
|
==842== by 0x4592C5: ForestKVStore::initForestDb() (forest-kvstore.cc:37)
|
==842== by 0x4599E0: ForestKVStore::ForestKVStore(KVStoreConfig&) (forest-kvstore.cc:109)
|
==842== by 0x43A956: KVStoreFactory::create(KVStoreConfig&, bool) (kvstore.cc:55)
|
==842== by 0x42A45C: setup_kv_store(KVStoreConfig&) (kvstore_test.cc:115)
|
==842== by 0x42A8D1: CouchAndForestTest_BasicTest_Test::TestBody() (kvstore_test.cc:152)
|
==842== by 0x49A971: void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) (gtest.cc:2078)
|
==842== by 0x4965A7: void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) (gtest.cc:2114)
|
==842== by 0x47F3E8: testing::Test::Run() (gtest.cc:2151)
|
A (very) brief investigation shows that fdb_open_inprog is still 1 when we call fdb_shutdown in the unit test, which means that shutdown fails (and we never call filemgr_shutdown() - see https://github.com/couchbase/forestdb/blob/master/src/forestdb.cc#L7666
Attachments
Issue Links
- relates to
-
MB-20355 couchstore: Memory leaks in ep-engine_kvstore_test
- Closed