practicalswift
commented at 4:36 pm on May 6, 2019:
contributor
While investigating #15948 (comment) I noticed that calling RewindBlockIndex and GetNetworkHashPS requires holding cs_main (due to accessing chainActive) without the functions being annotated as such.
This PR simply makes these implicit locking requirements explicit and adds two missing locks.
The only non-test caller not holding the now annotated locks was AppInitMain, but that was not a problem in practice since the RewindBlockIndex call happens before any background threads are started.
Add missing locking annotation for RewindBlockIndex. Add lock in AppInitMain.12d073adf3
Add missing locking annotation for GetNetworkHashPS50ee060c06
practicalswift renamed this:
Add locking annotation for RewindBlockIndex (requires holding cs_main)
Add locking annotations for RewindBlockIndex, GetNetworkHashPS and AddTx (ListCoinsTestingSetup)
on May 6, 2019
practicalswift force-pushed
on May 6, 2019
practicalswift renamed this:
Add locking annotations for RewindBlockIndex, GetNetworkHashPS and AddTx (ListCoinsTestingSetup)
Add locking annotations for RewindBlockIndex and GetNetworkHashPS. Add missing locks.
on May 6, 2019
Add missing lock in AddTx (ListCoinsTestingSetup)891be7a891
practicalswift force-pushed
on May 6, 2019
jamesob
commented at 5:18 pm on May 6, 2019:
member
#15931 (Remove GetDepthInMainChain dependency on locked chain interface by ariard)
#15855 ([refactor] interfaces: Add missing LockAnnotation for cs_main by MarcoFalke)
#13582 (Extract AppInitLoadBlockIndex from AppInitMain by Empact)
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
practicalswift closed this
on May 6, 2019
practicalswift
commented at 9:08 pm on May 6, 2019:
contributor
@promag Ouch! Thanks! Looks like we’re missing a few LOCKS_EXCLUDED annotations… Will rework - closing for now.
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-12-21 15:12 UTC
This site is hosted by @0xB10C More mirrored repositories can be found on mirror.b10c.me