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

Memory leaks when attempting to recover a corrupt backup

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Backup
    • Storage Engines
    • 5
    • 2024-03-19 - PacificOcean
    • Not Needed

      Removing tcmalloc from the ASAN build uncovered memory leaks exposed by the test: csuite-wt12015-backup-corruption-test

      One I've manged to fix in cur_backup.c, but the other is harder to resolve, the back trace points to a leak through conn->incr_backups but this is uncofirmed

      [2024/03/12 17:14:37.497] Create full backup into backup.3
      [2024/03/12 17:14:37.497] Verify backup 3
      [2024/03/12 17:14:37.497] =================================================================
      [2024/03/12 17:14:37.497] ==37158==ERROR: LeakSanitizer: detected memory leaks
      [2024/03/12 17:14:37.497] Direct leak of 8 byte(s) in 2 object(s) allocated from:
      [2024/03/12 17:14:37.497]     #0 0x4973cd in malloc /data/mci/cf02dab68c6203199a2c4dcdba60629c/toolchain-builder/tmp/build-llvm-v4.sh-Hnp/llvm-project-llvmorg/compiler-rt/lib/asan/asan_malloc_linux.cpp:145:3
      [2024/03/12 17:14:37.497]     #1 0x7f0c73185bc2 in __wt_malloc /data/mci/6756a0d10d53e0b7b54291b854ede203/wiredtiger/src/os_common/os_alloc.c:66:14
      [2024/03/12 17:14:37.497]     #2 0x7f0c731872d5 in __wt_strndup /data/mci/6756a0d10d53e0b7b54291b854ede203/wiredtiger/src/os_common/os_alloc.c:271:5
      [2024/03/12 17:14:37.497]     #3 0x7f0c72fb284b in __wt_backup_set_blkincr /data/mci/6756a0d10d53e0b7b54291b854ede203/wiredtiger/src/cursor/cur_backup.c:74:5
      [2024/03/12 17:14:37.497]     #4 0x7f0c733374e7 in __txn_system_op_apply /data/mci/6756a0d10d53e0b7b54291b854ede203/wiredtiger/src/txn/txn_recover.c:182:13
      [2024/03/12 17:14:37.497]     #5 0x7f0c733341fc in __txn_system_apply /data/mci/6756a0d10d53e0b7b54291b854ede203/wiredtiger/src/txn/txn_recover.c:211:9
      [2024/03/12 17:14:37.497]     #6 0x7f0c73332b69 in __txn_log_recover /data/mci/6756a0d10d53e0b7b54291b854ede203/wiredtiger/src/txn/txn_recover.c:512:13
      [2024/03/12 17:14:37.497]     #7 0x7f0c731013d8 in __wt_log_scan /data/mci/6756a0d10d53e0b7b54291b854ede203/wiredtiger/src/log/log.c:2393:13
      [2024/03/12 17:14:37.498]     #8 0x7f0c7332fc59 in __wt_txn_recover /data/mci/6756a0d10d53e0b7b54291b854ede203/wiredtiger/src/txn/txn_recover.c
      [2024/03/12 17:14:37.498]     #9 0x7f0c72f9f9af in __wt_connection_workers /data/mci/6756a0d10d53e0b7b54291b854ede203/wiredtiger/src/conn/conn_open.c:232:5
      [2024/03/12 17:14:37.498]     #10 0x7f0c72f586ff in wiredtiger_open /data/mci/6756a0d10d53e0b7b54291b854ede203/wiredtiger/src/conn/conn_api.c:3242:5
      [2024/03/12 17:14:37.498]     #11 0x4d3ac9 in testutil_wiredtiger_open /data/mci/6756a0d10d53e0b7b54291b854ede203/wiredtiger/test/utility/misc.c:388:5
      [2024/03/12 17:14:37.498]     #12 0x4c9832 in do_work_after_failure /data/mci/6756a0d10d53e0b7b54291b854ede203/wiredtiger/test/csuite/wt12015_backup_corruption/main.c:234:5
      [2024/03/12 17:14:37.498]     #13 0x4c920a in run_test_force_stop /data/mci/6756a0d10d53e0b7b54291b854ede203/wiredtiger/test/csuite/wt12015_backup_corruption/main.c:408:5
      [2024/03/12 17:14:37.498]     #14 0x4c8797 in main /data/mci/6756a0d10d53e0b7b54291b854ede203/wiredtiger/test/csuite/wt12015_backup_corruption/main.c:487:9
      [2024/03/12 17:14:37.498]     #15 0x7f0c72a04082 in __libc_start_main /build/glibc-wuryBv/glibc-2.31/csu/../csu/libc-start.c:308:16
      [2024/03/12 17:14:37.498] Direct leak of 8 byte(s) in 2 object(s) allocated from:
      [2024/03/12 17:14:37.498]     #0 0x4973cd in malloc /data/mci/cf02dab68c6203199a2c4dcdba60629c/toolchain-builder/tmp/build-llvm-v4.sh-Hnp/llvm-project-llvmorg/compiler-rt/lib/asan/asan_malloc_linux.cpp:145:3
      [2024/03/12 17:14:37.498]     #1 0x7f0c73185bc2 in __wt_malloc /data/mci/6756a0d10d53e0b7b54291b854ede203/wiredtiger/src/os_common/os_alloc.c:66:14
      [2024/03/12 17:14:37.498]     #2 0x7f0c731872d5 in __wt_strndup /data/mci/6756a0d10d53e0b7b54291b854ede203/wiredtiger/src/os_common/os_alloc.c:271:5
      [2024/03/12 17:14:37.498]     #3 0x7f0c72fb284b in __wt_backup_set_blkincr /data/mci/6756a0d10d53e0b7b54291b854ede203/wiredtiger/src/cursor/cur_backup.c:74:5
      [2024/03/12 17:14:37.498]     #4 0x7f0c733374e7 in __txn_system_op_apply /data/mci/6756a0d10d53e0b7b54291b854ede203/wiredtiger/src/txn/txn_recover.c:182:13
      [2024/03/12 17:14:37.498]     #5 0x7f0c733341fc in __txn_system_apply /data/mci/6756a0d10d53e0b7b54291b854ede203/wiredtiger/src/txn/txn_recover.c:211:9
      [2024/03/12 17:14:37.498]     #6 0x7f0c73332b69 in __txn_log_recover /data/mci/6756a0d10d53e0b7b54291b854ede203/wiredtiger/src/txn/txn_recover.c:512:13
      [2024/03/12 17:14:37.499]     #7 0x7f0c731013d8 in __wt_log_scan /data/mci/6756a0d10d53e0b7b54291b854ede203/wiredtiger/src/log/log.c:2393:13
      [2024/03/12 17:14:37.499]     #8 0x7f0c7332fc59 in __wt_txn_recover /data/mci/6756a0d10d53e0b7b54291b854ede203/wiredtiger/src/txn/txn_recover.c
      [2024/03/12 17:14:37.499]     #9 0x7f0c72f9f9af in __wt_connection_workers /data/mci/6756a0d10d53e0b7b54291b854ede203/wiredtiger/src/conn/conn_open.c:232:5
      [2024/03/12 17:14:37.499]     #10 0x7f0c72f586ff in wiredtiger_open /data/mci/6756a0d10d53e0b7b54291b854ede203/wiredtiger/src/conn/conn_api.c:3242:5
      [2024/03/12 17:14:37.499]     #11 0x4d3ac9 in testutil_wiredtiger_open /data/mci/6756a0d10d53e0b7b54291b854ede203/wiredtiger/test/utility/misc.c:388:5
      [2024/03/12 17:14:37.499]     #12 0x4ca5f9 in verify_backup /data/mci/6756a0d10d53e0b7b54291b854ede203/wiredtiger/test/csuite/wt12015_backup_corruption/main.c:169:5
      [2024/03/12 17:14:37.499]     #13 0x4c9c1a in do_work_after_failure /data/mci/6756a0d10d53e0b7b54291b854ede203/wiredtiger/test/csuite/wt12015_backup_corruption/main.c:285:5
      [2024/03/12 17:14:37.499]     #14 0x4c920a in run_test_force_stop /data/mci/6756a0d10d53e0b7b54291b854ede203/wiredtiger/test/csuite/wt12015_backup_corruption/main.c:408:5
      [2024/03/12 17:14:37.499]     #15 0x4c8797 in main /data/mci/6756a0d10d53e0b7b54291b854ede203/wiredtiger/test/csuite/wt12015_backup_corruption/main.c:487:9
      [2024/03/12 17:14:37.499]     #16 0x7f0c72a04082 in __libc_start_main /build/glibc-wuryBv/glibc-2.31/csu/../csu/libc-start.c:308:16
      [2024/03/12 17:14:41.628] bash: line 48: 37158 Aborted                 (core dumped) $(pwd)/test/csuite/wt12015_backup_corruption/test_wt12015_backup_corruption 2>&1
      [2024/03/12 17:14:41.632] SUMMARY: AddressSanitizer: 16 byte(s) leaked in 4 allocation(s).
      

            Assignee:
            marc.butler@mongodb.com Marc Butler (Inactive)
            Reporter:
            marc.butler@mongodb.com Marc Butler (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: