Small memory leak when BerkeleyEnvironment::Open fails #19034

issue ryanofsky openend this issue on May 20, 2020
  1. ryanofsky commented at 10:38 pm on May 20, 2020: contributor

    Originally reported #18907 (comment)

    This happens when trying to load a wallet with corrupt logs. It can be reproduced running the wallet_db.py test from #18907@c6a2c26. From https://travis-ci.org/github/bitcoin/bitcoin/jobs/689013660#L4659:

    0==2504==ERROR: LeakSanitizer: detected memory leaks
    1Direct leak of 65840 byte(s) in 2 object(s) allocated from:
    2    [#0](/bitcoin-bitcoin/0/) 0x55b144d4adb3 in __interceptor_malloc (/home/travis/build/bitcoin/bitcoin/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/bitcoind+0x1c75db3)
    3    [#1](/bitcoin-bitcoin/1/) 0x7f0207036cc4 in __os_malloc (/usr/lib/x86_64-linux-gnu/libdb_cxx-5.3.so+0x162cc4)
    4    [#2](/bitcoin-bitcoin/2/) 0x19f3b1afb25218ff  (<unknown module>)
    5SUMMARY: AddressSanitizer: 65840 byte(s) leaked in 2 allocation(s). 
    

    The leak is known to happen at commits 274b9909f64aa617eb322850b799bc38c04f5f0c (initial commit) and e78c6820232865f21777bfeefadac0a1aea1fde2 (attempted fix) from #18907

    This is probaby not a very severe issue, but it’d be good to track down the leak, fix it, and add the wallet_db test to have some test coverage for log recovery. All of this can be done independently of #18907, before or after it is merged.

  2. ryanofsky added the label Bug on May 20, 2020
  3. fanquake added the label Wallet on May 20, 2020
  4. ryanofsky commented at 1:58 pm on January 21, 2021: contributor

    Opened #20974 to test this. Leak does still happen https://cirrus-ci.com/task/5428735379767296?command=ci#L4680

    0==36296==ERROR: LeakSanitizer: detected memory leaks
    1Direct leak of 65840 byte(s) in 2 object(s) allocated from:
    2    [#0](/bitcoin-bitcoin/0/) 0x55fe2c45d3bd in malloc (/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/bitcoind+0x17733bd)
    3    [#1](/bitcoin-bitcoin/1/) 0x7f03e35788c4 in __os_malloc (/lib/x86_64-linux-gnu/libdb_cxx-5.3.so+0x1698c4)
    4SUMMARY: AddressSanitizer: 65840 byte(s) leaked in 2 allocation(s). 
    
  5. maflcko commented at 12:02 pm on July 3, 2024: member
    Closing per #20974 (comment)
  6. maflcko closed this on Jul 3, 2024


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-18 15:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me