Skip to content

Double lock detected in Warnings::GetMessages() #30400

@achow101

Description

@achow101

Is there an existing issue for this?

  • I have searched the existing issues

Current behaviour

Running bitcoin-qt -testnet results in it eventually deadlocking due to a double lock in the warnings code.

Expected behaviour

Should not double lock.

Steps to reproduce

  1. Build with --enable-debug (or define DEBUG_LOCKORDER
  2. Run bitcoin-qt -testnet, and either sync or reindex
  3. It will assert and crash on its own (without DEBUG_LOCKORDER, it will eventually hang)

Relevant log output

2024-07-05T23:22:12.212000Z [scheduler] [../../../src/qt/bitcoin.cpp:215] [DebugMessageHandler] [qt] GUI: ClientModel: NotifyAlertChanged
2024-07-05T23:22:12.212029Z [scheduler] [../../../src/sync.cpp:129] [double_lock_detected] DOUBLE LOCK DETECTED
2024-07-05T23:22:12.212052Z [scheduler] [../../../src/sync.cpp:130] [double_lock_detected] Lock order:
2024-07-05T23:22:12.212072Z [scheduler] [../../../src/sync.cpp:136] [double_lock_detected]  (*) 'm_mutex' in ../../../src/node/warnings.cpp:31 (in thread 'scheduler')
2024-07-05T23:22:12.212092Z [scheduler] [../../../src/sync.cpp:136] [double_lock_detected]  (*) 'm_mutex' in ../../../src/node/warnings.cpp:46 (in thread 'scheduler')
Assertion failed: detected double lock for 'm_mutex' in ../../../src/node/warnings.cpp:46 (in thread 'scheduler'), details in debug log.

How did you obtain Bitcoin Core

Compiled from source

What version of Bitcoin Core are you using?

bd5d168

Operating system and version

Arch

Machine specifications

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions