Page MenuHomePhabricator

[backport#15402] Prevent callback overruns in InvalidateBlock and RewindBlockIndex
ClosedPublic

Authored by majcosta on Aug 18 2020, 15:53.

Details

Summary

https://github.com/bitcoin/bitcoin/pull/15402/commits/9ce9c37004440d6a329874dbf66b51666d497dcb


This thing has been merged (D4803) and reverted (D4959) before. Seems to be working correctly now, with the lock to m_cs_chainstate in ActivateBestChain having a corresponding one in UnwindBlock.

Concludes backport of Core PR15402

Test Plan
cmake -GNinja -DCMAKE_BUILD_TYPE=Debug
ninja check check-functional

also

build without this patch, invalidate block #6 or similarly deep, see that bitcoind memory usage just keeps going up, even past 30% on my 16GB machine. build with this patch and do the same, memory usage stays steady at ~12% no matter how far you disconnect blocks.

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

[Bot Message]
One or more PR numbers were detected in the summary.
Links to those PRs have been inserted into the summary for reference.

jasonbcox requested changes to this revision.Aug 18 2020, 17:44
jasonbcox added a subscriber: jasonbcox.

Please run TSAN on this diff since the revert was tested that way. We should expect it to pass if it's really fixed.

This revision now requires changes to proceed.Aug 18 2020, 17:44
This revision is now accepted and ready to land.Aug 20 2020, 23:57