Page MenuHomePhabricator

Fix lock in getVerificationProgress

Authored by jasonbcox on Nov 25 2019, 20:10.


Group Reviewers
Restricted Project

This fixes our sanitizer builds which are currently red on master.

This is related to the currently open Core issue here:
and associated un-merged PR mentioned in the comment in GuessVerificationProgress:

// This function assumes the lock on cs_main is already held (see the
// above comment). This is a temporary check until PR15997 is backported.

However, PR15997 is currently closed, pending a different approach being reviewed in

Since it's unlikely that we'll be pulling in a refactor that large any time soon, we can apply this patch to fix the build in the mean time.

Test Plan

Run TSAN, ASAN, UBSAN builds on TeamCity

Diff Detail

rABC Bitcoin ABC
Lint OK
No Unit Test Coverage
Build Status
Buildable 8279
Build 14583: Default Diff Build & Tests
Build 14582: arc lint + arc unit

Event Timeline

jasonbcox created this revision.Nov 25 2019, 20:10
jasonbcox planned changes to this revision.Nov 25 2019, 20:10
jasonbcox edited the summary of this revision. (Show Details)Nov 25 2019, 20:56
jasonbcox edited the test plan for this revision. (Show Details)
jasonbcox edited the summary of this revision. (Show Details)
jasonbcox requested review of this revision.Nov 25 2019, 21:12
deadalnix requested changes to this revision.Nov 25 2019, 22:17

As The GuessVerificationProgress doc says:

//! Guess how far we are in the verification process at the given block index
//! require cs_main if pindex has not been validated yet (because nChainTx might
//! be unset)

So this does not seems to be an appropriate measure. Because no description of the problem is provided, it is difficult to suggest any alternative.

This revision now requires changes to proceed.Nov 25 2019, 22:17