fix: compile error due to rebase mistake between bitcoin#22937 and ipc/process#6199
Merged
PastaPastaPasta merged 2 commits intodashpay:developfrom Aug 12, 2024
Merged
Conversation
…der`
Avoid TSan-reported data race
```
WARNING: ThreadSanitizer: data race (pid=360336)
Write of size 8 at 0x7b5000002db8 by thread T15 (mutexes: write M0):
#0 BlockManager::AddToBlockIndex(CBlockHeader const&, uint256 const&, CBlockIndex*&, BlockStatus) /src/dash/src/node/blockstorage.cpp:117:25 (dashd+0x44df7a) (BuildId: e27186c7ba08e897d376eb5779db9809baf7ad37)
#1 ChainstateManager::AcceptBlockHeader(CBlockHeader const&, BlockValidationState&, CChainParams const&, CBlockIndex**) /src/dash/src/validation.cpp:3758:36 (dashd+0x83e45d) (BuildId: e27186c7ba08e897d376eb5779db9809baf7ad37)
dashpay#2 CChainState::AcceptBlock(std::shared_ptr<CBlock const> const&, BlockValidationState&, CBlockIndex**, bool, FlatFilePos const*, bool*) /src/dash/src/validation.cpp:3812:37 (dashd+0x842848) (BuildId: e27186c7ba08e897d376eb5779db9809baf7ad37)
[...]
Previous read of size 8 at 0x7b5000002db8 by thread T12:
#0 CDSNotificationInterface::UpdatedBlockTip(CBlockIndex const*, CBlockIndex const*, bool) /src/dash/src/dsnotificationinterface.cpp:82:42 (dashd+0x91e87e) (BuildId: e27186c7ba08e897d376eb5779db9809baf7ad37)
#1 operator() /src/dash/src/validationinterface.cpp:199:79 (dashd+0x889f1e) (BuildId: e27186c7ba08e897d376eb5779db9809baf7ad37)
dashpay#2 Iterate<(lambda at validationinterface.cpp:199:30)> /src/dash/src/validationinterface.cpp:88:17 (dashd+0x889f1e)
[...]
[...]
SUMMARY: ThreadSanitizer: data race [...]
```
kwvg
approved these changes
Aug 12, 2024
5 tasks
5 tasks
PastaPastaPasta
added a commit
that referenced
this pull request
Aug 29, 2024
… with Mutex, avoid data race, partial bitcoin#22868 87d775d partial bitcoin#22868: Call load handlers without cs_wallet locked (Kittywhiskers Van Gogh) c602ca1 coinjoin: protect `m_wallet_manager_map` with `cs_wallet_manager_map` (Kittywhiskers Van Gogh) Pull request description: ## Additional Information This pull request aims to deal with regressions ([build](https://gitlab.com/dashpay/dash/-/jobs/7550859495)) spotted in `develop` after the merger of [dash#6143](#6143), namely, a failure to build the multiprocess variant and two data races, one involving `ChainstateManager::m_best_header` and another involving `CoinJoinWalletManager::m_wallet_manager_map`. * Fixes for the build failure and the first data race (b136742 and 9e7c685), have been spun off into [dash#6199](#6199) and merged * The second data race is being avoided by protected `m_wallet_manager_map` with a new `RecursiveMutex`, `cs_wallet_manager_map` (the contents of this PR). ~~A version of these changes are available using a regular `Mutex` but prove far more cumbersome ([source](b89457d)) when taking practicalities into account ([comment](#6192 (comment) A `Mutex` version is now available courtesy of UdjinM6 (see [patch](ecf5c1b)), thanks! ## Checklist: - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas **(note: N/A)** - [x] I have added or updated relevant unit/integration/functional/e2e tests - [x] I have made corresponding changes to the documentation **(note: N/A)** - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: UdjinM6: light-ACK 87d775d Tree-SHA512: 52545a1547357a45fb6bf4d3948fc75a5e88f1d86e9809b1060007cd74dd383249691d8d9777f647c7534d458fe126ae818fa2b47f0e5b0cee78a469af1ed0c9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue being fixed or feature implemented
CI failure for multiprocess
What was done?
It resolve compilation failure on develop (apply changes from 22937 to ipc/process)
See alternate solutions:
How Has This Been Tested?
Run build locally:
Breaking Changes
N/A
Checklist: