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

Fix memory leak in verifying history store

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • WT10.0.0, 4.4.0-rc0, 4.7.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • 3
    • Storage Engines 2020-03-23

      Summary:
      Fix a memory leak in verifying the history store.


      =================================================================
          ==21647==ERROR: LeakSanitizer: detected memory leaks
      
          Direct leak of 81920 byte(s) in 1 object(s) allocated from:
              #0 0x4c3972 in realloc /data/mci/bb51bb2e9ea058cc981d517c2029628d/toolchain-builder/tmp/build-llvm.sh-ieZ/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:165:3
              #1 0x7628c8 in __realloc_func /home/chenhaoqu/work/wiredtiger/build_posix/../src/os_common/os_alloc.c:121:14
              #2 0x762a40 in __wt_realloc_noclear /home/chenhaoqu/work/wiredtiger/build_posix/../src/os_common/os_alloc.c:158:13
              #3 0x8b4e34 in __wt_buf_grow_worker /home/chenhaoqu/work/wiredtiger/build_posix/../src/support/scratch.c:47:13
              #4 0xb5338e in __wt_buf_grow /home/chenhaoqu/work/wiredtiger/build_posix/../src/include/buf.i:17:54
              #5 0xb5296c in __wt_buf_set /home/chenhaoqu/work/wiredtiger/build_posix/../src/include/buf.i:80:13
              #6 0xb51ff4 in __wt_verify_history_store_tree /home/chenhaoqu/work/wiredtiger/build_posix/../src/btree/bt_vrfy.c:673:9
              #7 0x855346 in __session_verify /home/chenhaoqu/work/wiredtiger/build_posix/../src/session/session_api.c:1602:13
              #8 0x5363e7 in wts_verify /home/chenhaoqu/work/wiredtiger/build_posix/test/format/../../../test/format/wts.c:482:11
              #9 0x5235b3 in main /home/chenhaoqu/work/wiredtiger/build_posix/test/format/../../../test/format/t.c:290:9
              #10 0x7fbe8791ab96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310
      
          Direct leak of 81920 byte(s) in 1 object(s) allocated from:
              #0 0x4c3972 in realloc /data/mci/bb51bb2e9ea058cc981d517c2029628d/toolchain-builder/tmp/build-llvm.sh-ieZ/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:165:3
              #1 0x7628c8 in __realloc_func /home/chenhaoqu/work/wiredtiger/build_posix/../src/os_common/os_alloc.c:121:14
              #2 0x762a40 in __wt_realloc_noclear /home/chenhaoqu/work/wiredtiger/build_posix/../src/os_common/os_alloc.c:158:13
              #3 0x8b4e34 in __wt_buf_grow_worker /home/chenhaoqu/work/wiredtiger/build_posix/../src/support/scratch.c:47:13
              #4 0xb5338e in __wt_buf_grow /home/chenhaoqu/work/wiredtiger/build_posix/../src/include/buf.i:17:54
              #5 0xb5296c in __wt_buf_set /home/chenhaoqu/work/wiredtiger/build_posix/../src/include/buf.i:80:13
              #6 0xb51ff4 in __wt_verify_history_store_tree /home/chenhaoqu/work/wiredtiger/build_posix/../src/btree/bt_vrfy.c:673:9
              #7 0x855346 in __session_verify /home/chenhaoqu/work/wiredtiger/build_posix/../src/session/session_api.c:1602:13
              #8 0x5363e7 in wts_verify /home/chenhaoqu/work/wiredtiger/build_posix/test/format/../../../test/format/wts.c:482:11
              #9 0x51a4ff in wts_rebalance /home/chenhaoqu/work/wiredtiger/build_posix/test/format/../../../test/format/rebalance.c:60:5
              #10 0x52374c in main /home/chenhaoqu/work/wiredtiger/build_posix/test/format/../../../test/format/t.c:298:9
              #11 0x7fbe8791ab96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310
      
          Direct leak of 81920 byte(s) in 1 object(s) allocated from:
              #0 0x4c3972 in realloc /data/mci/bb51bb2e9ea058cc981d517c2029628d/toolchain-builder/tmp/build-llvm.sh-ieZ/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:165:3
              #1 0x7628c8 in __realloc_func /home/chenhaoqu/work/wiredtiger/build_posix/../src/os_common/os_alloc.c:121:14
              #2 0x762a40 in __wt_realloc_noclear /home/chenhaoqu/work/wiredtiger/build_posix/../src/os_common/os_alloc.c:158:13
              #3 0x8b4e34 in __wt_buf_grow_worker /home/chenhaoqu/work/wiredtiger/build_posix/../src/support/scratch.c:47:13
              #4 0xb5338e in __wt_buf_grow /home/chenhaoqu/work/wiredtiger/build_posix/../src/include/buf.i:17:54
              #5 0xb5296c in __wt_buf_set /home/chenhaoqu/work/wiredtiger/build_posix/../src/include/buf.i:80:13
              #6 0xb51ff4 in __wt_verify_history_store_tree /home/chenhaoqu/work/wiredtiger/build_posix/../src/btree/bt_vrfy.c:673:9
              #7 0x855346 in __session_verify /home/chenhaoqu/work/wiredtiger/build_posix/../src/session/session_api.c:1602:13
              #8 0x5363e7 in wts_verify /home/chenhaoqu/work/wiredtiger/build_posix/test/format/../../../test/format/wts.c:482:11
              #9 0x51adcc in wts_salvage /home/chenhaoqu/work/wiredtiger/build_posix/test/format/../../../test/format/salvage.c:150:5
              #10 0x5238cb in main /home/chenhaoqu/work/wiredtiger/build_posix/test/format/../../../test/format/t.c:303:9
              #11 0x7fbe8791ab96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310
      
          Direct leak of 81920 byte(s) in 1 object(s) allocated from:
              #0 0x4c3972 in realloc /data/mci/bb51bb2e9ea058cc981d517c2029628d/toolchain-builder/tmp/build-llvm.sh-ieZ/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:165:3
              #1 0x7628c8 in __realloc_func /home/chenhaoqu/work/wiredtiger/build_posix/../src/os_common/os_alloc.c:121:14
              #2 0x762a40 in __wt_realloc_noclear /home/chenhaoqu/work/wiredtiger/build_posix/../src/os_common/os_alloc.c:158:13
              #3 0x8b4e34 in __wt_buf_grow_worker /home/chenhaoqu/work/wiredtiger/build_posix/../src/support/scratch.c:47:13
              #4 0xb5338e in __wt_buf_grow /home/chenhaoqu/work/wiredtiger/build_posix/../src/include/buf.i:17:54
              #5 0xb5296c in __wt_buf_set /home/chenhaoqu/work/wiredtiger/build_posix/../src/include/buf.i:80:13
              #6 0xb51ff4 in __wt_verify_history_store_tree /home/chenhaoqu/work/wiredtiger/build_posix/../src/btree/bt_vrfy.c:673:9
              #7 0x855346 in __session_verify /home/chenhaoqu/work/wiredtiger/build_posix/../src/session/session_api.c:1602:13
              #8 0x5363e7 in wts_verify /home/chenhaoqu/work/wiredtiger/build_posix/test/format/../../../test/format/wts.c:482:11
              #9 0x51ae45 in wts_salvage /home/chenhaoqu/work/wiredtiger/build_posix/test/format/../../../test/format/salvage.c:157:9
              #10 0x5238cb in main /home/chenhaoqu/work/wiredtiger/build_posix/test/format/../../../test/format/t.c:303:9
              #11 0x7fbe8791ab96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310
      
          SUMMARY: AddressSanitizer: 327680 byte(s) leaked in 4 allocation(s).
      

            Assignee:
            chenhao.qu@mongodb.com Chenhao Qu
            Reporter:
            chenhao.qu@mongodb.com Chenhao Qu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: