LoadExternalBlockFile is missing locking #6691

issue morcos openend this issue on September 18, 2015
  1. morcos commented at 3:28 am on September 18, 2015: member

    LoadExternalBlockFile accesses mapBlockIndex without any locks. But mapBlockIndex could be in the process of being modified. The fImporting flag should protect from a p2p message causing a modification, but submitblock can be modifying mapBlockIndex at the same time as LoadExternalBlockFile is reading it.

    In addition LoadExternalBlockFile calls ReadBlockFromDisk which really needs some of the variables in CBlockIndex which are accessed by GetBlockPos to be protected. All other reads of them happen to be protected by cs_main.

  2. laanwj added the label Bug on Sep 22, 2015
  3. morcos commented at 8:41 pm on October 19, 2015: member
    A related, but somewhat separate issue is that during reindexing it should not be possible to write data to the block files. The database of which files contain which blocks and where space exists for new blocks to be written is still in the process of being created. A submitblock RPC call during a reindexing seems like it would cause significant problems.
  4. meshcollider commented at 3:35 am on March 14, 2018: contributor
    I believe this was resolved in #11041 @morcos is your second comment still an issue, and if so would you like to open it as a separate issue thread and close this one?
  5. meshcollider closed this on Oct 14, 2018

  6. DrahtBot locked this on Sep 8, 2021


morcos meshcollider

Labels
Bug


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