Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-7451

Memory leak in WT

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • 1
    • Storage - Ra 2021-05-31

      I encountered a memory leak from WiredTiger in one of my mongodb patch build:

      [js_test:wt_repair_missing_files] d20027| =================================================================
      [js_test:wt_repair_missing_files] d20027| ==4346==ERROR: LeakSanitizer: detected memory leaks
      [js_test:wt_repair_missing_files] d20027|
      [js_test:wt_repair_missing_files] d20027| Indirect leak of 20480 byte(s) in 1 object(s) allocated from:
      [js_test:wt_repair_missing_files] d20027|     #0 0x5631d2405a72 in realloc /data/mci/2b29d50424b17e9bd64c23288b01e972/toolchain-builder/tmp/build-llvm.sh-h2X/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:165:3
      [js_test:wt_repair_missing_files] d20027|     #1 0x5631d4ed43e2 in __realloc_func /data/mci/9cb0730a6f1ae1e4492ebba3f23adab1/src/src/third_party/wiredtiger/src/os_common/os_alloc.c:122:14
      [js_test:wt_repair_missing_files] d20027|     #2 0x5631d4ed46b7 in __wt_realloc_aligned /data/mci/9cb0730a6f1ae1e4492ebba3f23adab1/src/src/third_party/wiredtiger/src/os_common/os_alloc.c:227:13
      [js_test:wt_repair_missing_files] d20027|     #3 0x5631d4fa67d4 in __wt_buf_grow_worker /data/mci/23d687a5b4b454353ad1b544cc67dd77/src/src/third_party/wiredtiger/src/support/scratch.c:45:13
      [js_test:wt_repair_missing_files] d20027|     #4 0x5631d536957b in __wt_buf_grow /data/mci/9cb0730a6f1ae1e4492ebba3f23adab1/src/src/third_party/wiredtiger/src/include/buf_inline.h:17:54
      [js_test:wt_repair_missing_files] d20027|     #5 0x5631d536957b in __wt_buf_init /data/mci/9cb0730a6f1ae1e4492ebba3f23adab1/src/src/third_party/wiredtiger/src/include/buf_inline.h:49
      [js_test:wt_repair_missing_files] d20027|     #6 0x5631d536957b in __wt_block_read_off /data/mci/9cb0730a6f1ae1e4492ebba3f23adab1/src/src/third_party/wiredtiger/src/block/block_read.c:295
      [js_test:wt_repair_missing_files] d20027|     #7 0x5631d5368f15 in __wt_bm_read /data/mci/9cb0730a6f1ae1e4492ebba3f23adab1/src/src/third_party/wiredtiger/src/block/block_read.c:103:5
      [js_test:wt_repair_missing_files] d20027|     #8 0x5631d5126e32 in __wt_bt_read /data/mci/9cb0730a6f1ae1e4492ebba3f23adab1/src/src/third_party/wiredtiger/src/btree/bt_io.c:38:9
      [js_test:wt_repair_missing_files] d20027|     #9 0x5631d51420f9 in __page_read /data/mci/9cb0730a6f1ae1e4492ebba3f23adab1/src/src/third_party/wiredtiger/src/btree/bt_read.c:141:5
      [js_test:wt_repair_missing_files] d20027|     #10 0x5631d51420f9 in __wt_page_in_func /data/mci/9cb0730a6f1ae1e4492ebba3f23adab1/src/src/third_party/wiredtiger/src/btree/bt_read.c:258
      [js_test:wt_repair_missing_files] d20027|     #11 0x5631d51d6009 in __wt_page_swap_func /data/mci/9cb0730a6f1ae1e4492ebba3f23adab1/src/src/third_party/wiredtiger/src/include/btree_inline.h:1742:11
      [js_test:wt_repair_missing_files] d20027|     #12 0x5631d51d6009 in __wt_row_search /data/mci/9cb0730a6f1ae1e4492ebba3f23adab1/src/src/third_party/wiredtiger/src/btree/row_srch.c:428
      [js_test:wt_repair_missing_files] d20027|     #13 0x5631d50e4f3b in __cursor_row_search /data/mci/9cb0730a6f1ae1e4492ebba3f23adab1/src/src/third_party/wiredtiger/src/btree/bt_cursor.c:367:5
      [js_test:wt_repair_missing_files] d20027|     #14 0x5631d50e4f3b in __wt_btcur_search_near /data/mci/9cb0730a6f1ae1e4492ebba3f23adab1/src/src/third_party/wiredtiger/src/btree/bt_cursor.c:653
      [js_test:wt_repair_missing_files] d20027|     #15 0x5631d4e0f704 in __curfile_search_near /data/mci/9cb0730a6f1ae1e4492ebba3f23adab1/src/src/third_party/wiredtiger/src/cursor/cur_file.c:232:5
      [js_test:wt_repair_missing_files] d20027|     #16 0x5631d508fcec in __recovery_file_scan /data/mci/9cb0730a6f1ae1e4492ebba3f23adab1/src/src/third_party/wiredtiger/src/txn/txn_recover.c:680:16
      [js_test:wt_repair_missing_files] d20027|     #17 0x5631d508ccb2 in __wt_txn_recover /data/mci/9cb0730a6f1ae1e4492ebba3f23adab1/src/src/third_party/wiredtiger/src/txn/txn_recover.c:887:5
      [js_test:wt_repair_missing_files] d20027|     #18 0x5631d4ddcbad in __wt_connection_workers /data/mci/9cb0730a6f1ae1e4492ebba3f23adab1/src/src/third_party/wiredtiger/src/conn/conn_open.c:217:5
      [js_test:wt_repair_missing_files] d20027|     #19 0x5631d4da2291 in wiredtiger_open /data/mci/9cb0730a6f1ae1e4492ebba3f23adab1/src/src/third_party/wiredtiger/src/conn/conn_api.c:2995:5
      [js_test:wt_repair_missing_files] d20027|     #20 0x5631d4c5b193 in mongo::WiredTigerKVEngine::_openWiredTiger(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) /data/mci/23d687a5b4b454353ad1b544cc67dd77/src/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp:657:11
      [js_test:wt_repair_missing_files] d20027|     #21 0x5631d4c537d4 in mongo::WiredTigerKVEngine::WiredTigerKVEngine(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, mongo::ClockSource*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long, unsigned long, bool, bool, bool, bool) /data/mci/23d687a5b4b454353ad1b544cc67dd77/src/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp:462:5
      [js_test:wt_repair_missing_files] d20027|     #22 0x5631d2ecab19 in std::_MakeUniq<mongo::WiredTigerKVEngine>::__single_object std::make_unique<mongo::WiredTigerKVEngine, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, mongo::ClockSource*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, unsigned long&, unsigned long, bool const&, bool const&, bool const&, bool const&>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, mongo::ClockSource*&&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, unsigned long&, unsigned long&&, bool const&, bool const&, bool const&, bool const&) /opt/mongodbtoolchain/revisions/32eb70c47bd9e9759dd05654843feb80461aaef3/stow/gcc-v3.pgi/lib/gcc/x86_64-mongodb-linux/8.3.0/../../../../include/c++/8.3.0/bits/unique_ptr.h:831:34
      [js_test:wt_repair_missing_files] d20027|     #23 0x5631d2ecab19 in mongo::(anonymous namespace)::WiredTigerFactory::create(mongo::OperationContext*, mongo::StorageGlobalParams const&, mongo::StorageEngineLockFile const*) const /data/mci/9cb0730a6f1ae1e4492ebba3f23adab1/src/src/mongo/db/storage/wiredtiger/wiredtiger_init.cpp:105
      [js_test:wt_repair_missing_files] d20027|     #24 0x5631d601f9a1 in mongo::initializeStorageEngine(mongo::OperationContext*, mongo::StorageEngineInitFlags) /data/mci/9cb0730a6f1ae1e4492ebba3f23adab1/src/src/mongo/db/storage/storage_engine_init.cpp:158:18
      [js_test:wt_repair_missing_files] d20027|     #25 0x5631d24503c1 in mongo::(anonymous namespace)::_initAndListen(mongo::ServiceContext*, int) /data/mci/9cb0730a6f1ae1e4492ebba3f23adab1/src/src/mongo/db/mongod_main.cpp:407:9
      [js_test:wt_repair_missing_files] d20027|     #26 0x5631d243e6e8 in mongo::(anonymous namespace)::initAndListen(mongo::ServiceContext*, int) /data/mci/9cb0730a6f1ae1e4492ebba3f23adab1/src/src/mongo/db/mongod_main.cpp:796:16
      [js_test:wt_repair_missing_files] d20027|     #27 0x5631d243e6e8 in mongo::mongod_main(int, char**) /data/mci/9cb0730a6f1ae1e4492ebba3f23adab1/src/src/mongo/db/mongod_main.cpp:1454
      [js_test:wt_repair_missing_files] d20027|     #28 0x5631d24377ca in main /data/mci/9cb0730a6f1ae1e4492ebba3f23adab1/src/src/mongo/db/mongod.cpp:47:22
      [js_test:wt_repair_missing_files] d20027|     #29 0x7f864b609bf6 in __libc_start_main /build/glibc-S9d2JN/glibc-2.27/csu/../csu/libc-start.c:310
      

            Assignee:
            sulabh.mahajan@mongodb.com Sulabh Mahajan
            Reporter:
            chenhao.qu@mongodb.com Chenhao Qu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: