Skip to content

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

Closed

Description

@achow101

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

terminate called after throwing an instance of 'std::filesystem::__cxx11::filesystem_error'
  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

Activity

  1. hebasto commented on Apr 5, 2024

    @hebasto
    Member

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

  2. achow101 commented on Apr 5, 2024

    @achow101
    MemberAuthor

    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.

  3. hebasto commented on Apr 6, 2024

    @hebasto
    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.

  4. hebasto commented on Apr 6, 2024

    @hebasto
    Member

    I wonder if SQLite bothers to call CloseHandle() on Windows?

  5. deleted a comment from on Apr 7, 2024
  6. deleted a comment from michaelwklein on May 6, 2024
  7. hebasto commented on May 16, 2024

    @hebasto
    Member

    cc @furszy as an author of #28894.

  8. furszy commented on May 16, 2024

    @furszy
    Member
  9. hebasto commented on May 16, 2024

    @hebasto
    Member

    My research shows that

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

  10. furszy commented on May 16, 2024

    @furszy
    Member

    My research shows that

    // Cleanup
    wallet.reset();

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

    Great 👍🏼 . #30122 releases the wallet too.

  11. added a commit that references this issue on May 29, 2024
  12. hebasto commented on Jun 3, 2024

    @hebasto
    Member

    Can be closed as fixed by #30122.

  13. locked and limited conversation to collaborators on Jun 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions