reconsiderblock is prone to deadlocks when -checkblockindex=1 #16998

issue Sjors openend this issue on September 30, 2019
  1. Sjors commented at 2:36 pm on September 30, 2019: member

    Steps to reproduce :

    Configure with --enable-debug and run with -checkblockindex=1 .

    1. invalidateblock …
    2. reconsiderblock …

    Progress for reconsiderblock stops at some point, at least in the log. But CPU activity remains at 100%. It seems to happen shortly after it connects to new peers. Calling setnetworkactive false before reconsiderblock seems to prevent the issue.

    ctrl + c will not stop bitcoind, it doesn’t go beyond “addcon thread exit” and “net thread exit”.

    When running QT, it becomes completely unresponsive.

    bitcoin-cli stop will say “Bitcoin Core stopping”, but that’s a lie.

    In addition, calling reconsiderblock very early after start, before you see ERROR: AcceptBlockHeader: block 0000000000000000000212eb9b17aeb6e2a1527923ba79527cd8373f1d44307d is marked invalid, will prevent the chain from moving until you force-quit.

    Launching bitcoind without -checkblockindex=1 doesn’t seem to have this issue.

    Tried on master @ c3a8e097b1afe27bce2f71817fd23cb857236d9d.

  2. Sjors added the label Bug on Sep 30, 2019
  3. Sjors renamed this:
    reconsiderblock is prone to deadlocks
    reconsiderblock is prone to deadlocks when -checkblockindex=1
    on Sep 30, 2019
  4. promag commented at 7:11 pm on October 3, 2019: member

    bitcoin-cli stop will say “Bitcoin Core stopping”, but that’s a lie.

    👮

  5. MarcoFalke commented at 7:49 pm on October 11, 2019: member
    Can you attach gdb -p ${the_pid} and run thread apply all bt?
  6. Sjors commented at 12:55 pm on September 6, 2022: member
    Closing because this is too long and too many refactors ago.
  7. Sjors closed this on Sep 6, 2022

  8. bitcoin locked this on Sep 6, 2023

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-11-23 12:12 UTC

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