Document validationinterace callback blocking deadlock potential.#13402
Merged
maflcko merged 1 commit intobitcoin:masterfrom Jun 15, 2018
Merged
Document validationinterace callback blocking deadlock potential.#13402maflcko merged 1 commit intobitcoin:masterfrom
maflcko merged 1 commit intobitcoin:masterfrom
Conversation
randolf
approved these changes
Jun 6, 2018
ryanofsky
reviewed
Jun 6, 2018
| // never happen in normal operation, however may happen during | ||
| // reindex, causing memory blowup if we run too far ahead. | ||
| // Note that if a validationinterface callback ends up calling | ||
| // ActivateBestChain this may lead to a deadlock! We should |
Contributor
There was a problem hiding this comment.
Maybe add that this could lead to a deadlock "because ActiveBestChain won't be able to acquire m_cs_chainstate", if this is correct, to avoid making a puzzle of where the deadlock is.
Contributor
Note to reviewers: This pull request conflicts with the following ones:
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. |
This was referenced Jun 7, 2018
Merged
sipa
reviewed
Jun 15, 2018
| * Process incoming block headers. | ||
| * | ||
| * Call without cs_main held. | ||
| * May not be called with cs_main held. May not be called in a |
Member
There was a problem hiding this comment.
Can you add an AssertLockNotHeld(cs_main) to ProcessNewBlockHeaders then?
| /** Mark a block as precious and reorganize. */ | ||
| /** Mark a block as precious and reorganize. | ||
| * | ||
| * May not be called with cs_main held. May not be called in a |
Member
|
utACK 25bc961 |
maflcko
pushed a commit
that referenced
this pull request
Jun 15, 2018
…potential. 25bc961 Document validationinterace callback blocking deadlock potential. (Matt Corallo) Pull request description: From the branches-I've-had-lying-around-and-forgot-to-PR department... This is a comment-only PR, but the comments point out an API quirk that isn't exactly trivial. None of our use-cases right now hit this, but if we were to call SyncWithValidationInterfaceQueue (eg to limit queue depth) in ATMP, I'm pretty sure we'd hit a deadlock there. Tree-SHA512: 889dd8fc9eb15d1f2aa5ca467e783bc8f07bc543b166b032741795b0db7a0df11a2846d3cb7c69bafa8d1acf970021001b742f52be06725a932813230c5b4a7b
laanwj
added a commit
that referenced
this pull request
Jul 9, 2018
fa324a8 doc: Rewrite some validation doc as lock annotations (MarcoFalke) Pull request description: #13402 added some lock annotations in comments. This pull removes them and adds clang-readable locking annotations instead. Tree-SHA512: 2d392efa8ac4978830a9df08b2009e69d6f1ac031f62be2275ae8d7c7e483331c7f8d458d865443af907a7af27a592421c6cca6b2df3f2877e0f369b9198f383
jasonbcox
pushed a commit
to Bitcoin-ABC/bitcoin-abc
that referenced
this pull request
Sep 27, 2019
…potential. Summary: 25bc961 Document validationinterace callback blocking deadlock potential. (Matt Corallo) Pull request description: From the branches-I've-had-lying-around-and-forgot-to-PR department... This is a comment-only PR, but the comments point out an API quirk that isn't exactly trivial. None of our use-cases right now hit this, but if we were to call SyncWithValidationInterfaceQueue (eg to limit queue depth) in ATMP, I'm pretty sure we'd hit a deadlock there. Tree-SHA512: 889dd8fc9eb15d1f2aa5ca467e783bc8f07bc543b166b032741795b0db7a0df11a2846d3cb7c69bafa8d1acf970021001b742f52be06725a932813230c5b4a7b Backport of Core PR13402 bitcoin/bitcoin#13402 Depends on D4138 Test Plan: make check Reviewers: deadalnix, Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc Reviewed By: jasonbcox, O1 Bitcoin ABC, #bitcoin_abc Differential Revision: https://reviews.bitcoinabc.org/D4139
PastaPastaPasta
pushed a commit
to PastaPastaPasta/dash
that referenced
this pull request
Jul 7, 2020
…adlock potential. 25bc961 Document validationinterace callback blocking deadlock potential. (Matt Corallo) Pull request description: From the branches-I've-had-lying-around-and-forgot-to-PR department... This is a comment-only PR, but the comments point out an API quirk that isn't exactly trivial. None of our use-cases right now hit this, but if we were to call SyncWithValidationInterfaceQueue (eg to limit queue depth) in ATMP, I'm pretty sure we'd hit a deadlock there. Tree-SHA512: 889dd8fc9eb15d1f2aa5ca467e783bc8f07bc543b166b032741795b0db7a0df11a2846d3cb7c69bafa8d1acf970021001b742f52be06725a932813230c5b4a7b
PastaPastaPasta
pushed a commit
to PastaPastaPasta/dash
that referenced
this pull request
Jul 9, 2020
…tions fa324a8 doc: Rewrite some validation doc as lock annotations (MarcoFalke) Pull request description: bitcoin#13402 added some lock annotations in comments. This pull removes them and adds clang-readable locking annotations instead. Tree-SHA512: 2d392efa8ac4978830a9df08b2009e69d6f1ac031f62be2275ae8d7c7e483331c7f8d458d865443af907a7af27a592421c6cca6b2df3f2877e0f369b9198f383
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
From the branches-I've-had-lying-around-and-forgot-to-PR department...
This is a comment-only PR, but the comments point out an API quirk that isn't exactly trivial. None of our use-cases right now hit this, but if we were to call SyncWithValidationInterfaceQueue (eg to limit queue depth) in ATMP, I'm pretty sure we'd hit a deadlock there.