-
Notifications
You must be signed in to change notification settings - Fork 38.7k
sync.h: fix LockAssertion error reporting #19970
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
39e8f5b to
07ccd1d
Compare
07ccd1d to
df7a0ab
Compare
vasild
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK df7a0ab
That is an improvement over the current state of affairs.
Feel free to rename LOCK_ASSERTION() to SUPPRESS_THREAD_SAFETY_ANALYSIS_AND_FORCE_THE_COMPILER_TO_THINK_THAT_WE_OWN_THE_MUTEX_HERE().
|
Code review ACK df7a0ab. Code change looks fine, but I think this is a bad approach for a few reasons:
|
Both of those are appropriate justifications for a PR to change the approach. They'd be a valid objection to something that somehow prevents future PRs from changing the approach, but this PR doesn't do that.
The developer notes state that using compile-time annotations are to be used consistently, and LOCK_ASSERTION is only to be used when that fails. The implementation of LOCK_ASSERTION as it stands will cause compile errors if you use the wrong assertion. I think you're completely mistaken in thinking LOCK_ASSERTION looks "safer" than "AssertLockHeld".
It's a "fix" because it corrects obviously broken behaviour, and it's "quick" because it leaves the issues where there's debate about what to do them to be addressed elsewhere. This isn't an "alternative" to other approaches as you suggest in your edit to the PR description, it's just a first step. |
maflcko
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK df7a0ab
This doesn't change the use of EXCLUSIVE_LOCK_FUNCTION, which can be changed in independent follow-up prs. This only passes the correct line numbers to AssertLockHeldInternal, which is a fix.
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, 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 pull request conflicts with the target branch and needs rebase. Want to unsubscribe from rebase notifications on this pull request? Just convert this pull request to a "draft". |
|
No longer relevant |
Signet
38332, 38334 -> 31932, 31934
m_onion_service_target_port
main: 51734, test: 51934, regtest: 51931
sendtoaddress gets new parameter: verbose
Argument names are enforced.
Changed functional tests to pass by position instead of by name.
AcceptToMemoryPool returns fee instead of taking absurdfee parameter
OP_CHECKSIGADD
SCRIPT_VERIFY_TAPROOT in GetBlockScriptFlags
CheckSig renamed to CheckECDSASignature
Replaced PrecomputedTransactionData::m_spent_outputs CTxOut with CTxOutSign
Add walletinitinterface.h to Makefile
CHDWalletDB removed open_mode
Replaced boost::bind in smessage.cpp
Default wallets no longer created
ParticlTestFramework start_nodes, insert -wallet to extra_args
functional test extra_args are not being passed anymore
hasattr in ParticlTestFramework::start_nodes
LockAssertion is gone
Clang thread analysis can't track mutex aliases, cs_wallet on CWallet is not seen when used through CHDWallet
Used LOCK_ASSERTION from bitcoin#19970
Converted CODEOWNERS file
This fixes LockAssertion's incorrect line number reporting, with minimal changes.
PR is compared with alternatives in https://github.com/bitcoin-core/bitcoin-devwiki/wiki/AssertLockHeld-PRs