corruption due to lack of memory is not handled #19066

issue rebroad opened this issue on May 25, 2020
  1. rebroad commented at 3:56 AM on May 25, 2020: contributor

    My node ran out of memory while processing a blocktxn:-

    2020-05-24 01:52:51.790 recv blocktxn 00000000000000000003a7888f845933fb26c15993deb6092c44b43ef96fcc20 (631487) age=54s indexes=1036 size=1450359 peer=128 2020-05-24 01:52:51.867 made block 00000000000000000003a7888f845933fb26c15993deb6092c44b43ef96fcc20 size=1511809 txs: mempool=142+3 req=1036 2020-05-24 01:52:52.429 ProcessNewBlock: Calling ActivateBestChain() 2020-05-24 01:57:09.964


    EXCEPTION: St9bad_alloc
    std::bad_alloc
    bitcoin in ProcessMessages()

    2020-05-24 01:57:10.004 ProcessMessages(blocktxn, 1450359 bytes) FAILED peer=128

    but now any subsequent blocks are being marked as invalid:-

    2020-05-24 02:51:32.291 ERROR: ConnectBlock(): inputs missing/spent 2020-05-24 02:51:32.291 InvalidChainFound: invalid block=00000000000000000006cad2fa2e041afac8973d4ebbe606296c516f08e29c80 height=631488 log2_work=91.973518 date=2020-05-24 02:04:06 2020-05-24 02:51:32.291 InvalidChainFound: current best=00000000000000000003a7888f845933fb26c15993deb6092c44b43ef96fcc20 height=631487 log2_work=91.973498 date=2020-05-24 01:51:56 2020-05-24 02:51:32.291 ERROR: ConnectTip(): ConnectBlock 00000000000000000006cad2fa2e041afac8973d4ebbe606296c516f08e29c80 failed.

    reconsiderblock does not allow it to fix the apparent corruption (using the latest master)

  2. rebroad added the label Bug on May 25, 2020
  3. laanwj commented at 2:40 PM on May 25, 2020: member

    This is strange. I'm not sure how this can happen.

    To prevent this from happening the new handler is overridden to prevent bad_alloc from ever being raised here: https://github.com/bitcoin/bitcoin/blob/master/src/init.cpp#L905 This was introduced in #9856 (first in v0.15.0).

  4. rebroad commented at 12:15 PM on May 28, 2020: contributor

    @laanwj the corruption happened on a version prior to #9856 (v13.99) but I ran the latest master hoping it would be able to recover, and it didn't.

  5. fanquake closed this on May 28, 2020

  6. MarcoFalke commented at 1:21 PM on May 28, 2020: member

    v13.99 is EOL and no longer supported

  7. fanquake locked this on Jul 9, 2020
Labels

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: 2026-04-22 18:14 UTC

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