WalletCreate{Encrypted/Plain} benchmark crash on Windows #29816

issue achow101 openend this issue on April 5, 2024
  1. achow101 commented at 5:03 pm on April 5, 2024: member

    Is there an existing issue for this?

    • I have searched the existing issues

    Current behaviour

    After modifying the guix build script for 27.0rc1 to produce the benchmark binary, when bench_bitcoin is run on Windows, it crashes on the WalletCreateEncrypted and WalletCreatePlain benchmarks with

    0terminate called after throwing an instance of 'std::filesystem::__cxx11::filesystem_error'
    1  what():  filesystem error: cannot remove all: Broken pipe [C:\Users\ava\AppData\Local\Temp\test_common_Bitcoin Core\3429246d6bc3edb33b654eaa193f00685cbc45e5b8e31d04b784a4139314cbf9] [C:\Users\ava\AppData\Local\Temp\test_common_Bitcoin Core\3429246d6bc3edb33b654eaa193f00685cbc45e5b8e31d04b784a4139314cbf9\test_wallet_4003727542\wallet.dat]
    

    I have not tested with a MSVC build.

    Expected behaviour

    Shouldn’t crash

    Steps to reproduce

    1. Checkout 27.0rc1
    2. Remove --disable-bench from guix’s configure
    3. Do guix build
    4. Extract bench_bitcoin.exe
    5. bench_bitcoin.exe -filter="WalletCreateEncrypted" and/or bench_bitcoin.exe -filter="WalletCreatePlain"
    6. Crash

    Relevant log output

    No response

    How did you obtain Bitcoin Core

    Compiled from source

    What version of Bitcoin Core are you using?

    27.0rc1

    Operating system and version

    Windows 10

    Machine specifications

    No response

  2. achow101 added the label Windows on Apr 5, 2024
  3. hebasto commented at 5:10 pm on April 5, 2024: member
    Does your Windows user have an OS permission to create symbolic links?
  4. achow101 commented at 5:17 pm on April 5, 2024: member

    Does your Windows user have an OS permission to create symbolic links?

    No, but even when run as admin which does, the error still occurs.

  5. hebasto commented at 11:56 am on April 6, 2024: member

    It seems the same issue as I noticed in #29773.

    From @sipsorcery’s comment:

    only guessing but I’ve always found Windows fairly average at releasing file and socket handles. Maybe that’s the cause of the test failure rather than anything code related.

    In my other life I work with SIP (telecoms protocol) with lots of socket handles flying around. If it’s only for testing then I generally just add a 5 second wait and try again for handle in use errors.

  6. hebasto commented at 12:15 pm on April 6, 2024: member
    I wonder if SQLite bothers to call CloseHandle() on Windows?
  7. bitcoin deleted a comment on Apr 7, 2024
  8. bitcoin deleted a comment on May 6, 2024
  9. hebasto commented at 11:27 am on May 16, 2024: member
    cc @furszy as an author of #28894.
  10. furszy commented at 12:57 pm on May 16, 2024: member
  11. hebasto commented at 1:48 pm on May 16, 2024: member
    My research shows that https://github.com/bitcoin/bitcoin/blob/dd42a5ddea6a72e1e9cad54f8352c76b0b701973/src/bench/wallet_create.cpp#L43-L44 does not trigger the shared_ptr<CWallet> deleter, which is ReleaseWallet(), because wallet.use_count() == 3.
  12. furszy commented at 1:54 pm on May 16, 2024: member

    My research shows that

    https://github.com/bitcoin/bitcoin/blob/dd42a5ddea6a72e1e9cad54f8352c76b0b701973/src/bench/wallet_create.cpp#L43-L44

    does not trigger the shared_ptr<CWallet> deleter, which is ReleaseWallet(), because wallet.use_count() == 3.

    Great 👍🏼 . #30122 releases the wallet too.

  13. fanquake referenced this in commit 10164916f7 on May 29, 2024
  14. hebasto commented at 3:44 pm on June 3, 2024: member
    Can be closed as fixed by #30122.
  15. fanquake closed this on Jun 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-30 15:12 UTC

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