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

Fix memory leak in __wt_background_compact_signal

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • WT11.3.0, 7.3.0-rc0
    • Affects Version/s: None
    • Component/s: Compaction
    • None
    • 2
    • 2023-11-28 - Anthill Tiger

      A mongodb patch build with the new autoCompact command uncovered a memory leak in __wt_background_compact_signal.  We need to free stripped_config allocated by wt_config_merge.

      [j0] =================================================================
      
      [j0] ==7846==ERROR: LeakSanitizer: detected memory leaks
      [j0] 
      [j0] Direct leak of 192 byte(s) in 6 object(s) allocated from:
      [j0]     #0 0x5626db69e30d in malloc /data/mci/0daf2ee55223f87d23db2ac2806d764d/toolchain-builder/tmp/build-llvm-v4.sh-PAU/llvm-project-llvmorg/compiler-rt/lib/asan/asan_malloc_linux.cpp:145:3
      [j0]     #1 0x7f7060e0a7df in __wt_malloc /data/mci/416c681b82960115dafe8c476d2b048f/src/src/third_party/wiredtiger/src/os_common/os_alloc.c:91:14
      [j0]     #2 0x7f7060e0c9ca in __wt_strndup /data/mci/416c681b82960115dafe8c476d2b048f/src/src/third_party/wiredtiger/src/os_common/os_alloc.c:295:5
      [j0]     #3 0x7f7060ad5c06 in __config_merge_format /data/mci/416c681b82960115dafe8c476d2b048f/src/src/third_party/wiredtiger/src/config/config_collapse.c:285:11
      [j0]     #4 0x7f7060ad5c06 in __wt_config_merge /data/mci/416c681b82960115dafe8c476d2b048f/src/src/third_party/wiredtiger/src/config/config_collapse.c:366:11
      [j0]     #5 0x7f7060b2f3a0 in __wt_background_compact_signal /data/mci/416c681b82960115dafe8c476d2b048f/src/src/third_party/wiredtiger/src/conn/conn_compact.c:690:5
      [j0]     #6 0x7f7060f7bef9 in __wt_session_compact /data/mci/416c681b82960115dafe8c476d2b048f/src/src/third_party/wiredtiger/src/session/session_compact.c:435:9
      [j0]     #7 0x7f7071504914 in mongo::WiredTigerKVEngine::autoCompact(mongo::OperationContext*, bool, boost::optional<long>) /data/mci/8d6ede16353f16ae1634c8f0dff31b82/src/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp:2794:15
      

            Assignee:
            sean.watt@mongodb.com Sean Watt
            Reporter:
            sean.watt@mongodb.com Sean Watt
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: