-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Do not clear validationinterface entries being executed #18551
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
Do not clear validationinterface entries being executed #18551
Conversation
|
I take it this resolves this comment? |
|
@fanquake You're too fast. I was just looking to add a link where I made that comment. |
|
This change is now covered in #18471. |
Bug in MainSignalsInstance::Clear could cause validation interface callbacks to be deleted during execution if UnregisterAllValidationInterfaces was called more than once. Bug was introduced in bitcoin#18524 and is fixed by bitcoin#18551
|
Note: This PR fixes a bug in an internal function. The fix doesn't affect behavior of bitcoind, the gui, or any utilities because the function isn't currently called in a way that would trigger the bug |
|
Code review ACK c182fd5. |
The previous code for MainSignalsInstance::Clear would decrement the reference count of every interface, including ones that were already Unregister()ed but still being executed.
Bug in MainSignalsInstance::Clear could cause validation interface callbacks to be deleted during execution if UnregisterAllValidationInterfaces was called more than once. Bug was introduced in bitcoin#18524 and is fixed by bitcoin#18551
c182fd5 to
2276339
Compare
|
@ryanofsky Cherry-picked. Also updated the PR description to say it's not currently observable. |
ryanofsky
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.
Code review ACK 2276339. No change to bugfix, just rebased and new test commit added since last review
|
utACK 2276339 - reviewed code and test (thanks @ryanofsky for adding the test). |
|
ACK 2276339 🎎 Show signature and timestampSignature: Timestamp of file with hash |
|
cc @sipsorcery (or anyone else on windows) any idea why this fails appveyor? |
Appveyor links https://ci.appveyor.com/project/DrahtBot/bitcoin/builds/32000822 (passed) I think this is the error message |
|
Yeah, stuff like this #16976 makes it hard to debug |
|
The PR was rebased between the passing build and failing build https://github.com/bitcoin/bitcoin/compare/c182fd51..2276339a, but I'd guess probably the new EDIT: Actually that diff link is misleading because appveyor builds branches merged with master. Still it seems pretty likely the new |
|
Could disable this if appveyor failures cause problems for other PRs: --- a/src/test/validationinterface_tests.cpp
+++ b/src/test/validationinterface_tests.cpp
@@ -42,6 +42,9 @@ public:
// https://github.com/bitcoin/bitcoin/pull/18551
BOOST_AUTO_TEST_CASE(unregister_all_during_call)
{
+#ifdef WIN32
+ return;
+#endif
bool destroyed = false;
CScheduler scheduler; |
|
appveyor was already failing on pretty much every pull, so I think this is not an issue |
|
The tests are now failing, and it was caused by this pull. Maybe we can disable as @ryanofsky suggested. I haven't been able to investigate further: |
|
I think I see the problem. The failing assert is in bitcoin/src/validationinterface.cpp Line 93 in 1f70185
and is probably failing because the test isn't calling |
Use TestingSetup fixture to fix unregister_all_during_call test not calling UnregisterBackgroundSignalScheduler, which could trigger an assert in RegisterBackgroundSignalScheduler when called in later tests Failure reported by fanquake <[email protected]> bitcoin#18551 (comment)
|
#18563 should probably fix the test failures |
13d2a33 Fix unregister_all_during_call cleanup (Russell Yanofsky) Pull request description: Use `TestingSetup` fixture to fix `unregister_all_during_call` test not calling `UnregisterBackgroundSignalScheduler`, which could trigger an assert in `RegisterBackgroundSignalScheduler` when called in later tests Failure reported by fanquake bitcoin#18551 (comment) ACKs for top commit: MarcoFalke: ACK 13d2a33 if appveyor unit tests pass Tree-SHA512: d2ec8ff14c54d97903af50031abfac1f38ec1c3aabc90371cfd5b79481fa69d3d77f339bfdf7d2178fd85e83402f72eda7cf4d339e5bbfa7e6e1a68836643b93
Bug in MainSignalsInstance::Clear could cause validation interface callbacks to be deleted during execution if UnregisterAllValidationInterfaces was called more than once. Bug was introduced in bitcoin#18524 and is fixed by bitcoin#18551
Use TestingSetup fixture to fix unregister_all_during_call test not calling UnregisterBackgroundSignalScheduler, which could trigger an assert in RegisterBackgroundSignalScheduler when called in later tests Failure reported by fanquake <[email protected]> bitcoin#18551 (comment)
Bug in MainSignalsInstance::Clear could cause validation interface callbacks to be deleted during execution if UnregisterAllValidationInterfaces was called more than once. Bug was introduced in bitcoin#18524 and is fixed by bitcoin#18551
Use TestingSetup fixture to fix unregister_all_during_call test not calling UnregisterBackgroundSignalScheduler, which could trigger an assert in RegisterBackgroundSignalScheduler when called in later tests Failure reported by fanquake <[email protected]> bitcoin#18551 (comment)
Summary: 2276339a176f83ffe8ceefb3e41ecca8601aa13b Add test for UnregisterAllValidationInterfaces bug (Russell Yanofsky) 3c61abbbc847d725f30d169278d84655571407c1 Do not clear validationinterface entries being executed (Pieter Wuille) Pull request description: The previous code for MainSignalsInstance::Clear would decrement the reference count of every interface, including ones that were already Unregister()ed but still being executed. This fixes the issue pointed out here: https://github.com/bitcoin/bitcoin/pull/18524/files#r404395685 . It's not currently observable. ACKs for top commit: jonasschnelli: utACK 2276339a176f83ffe8ceefb3e41ecca8601aa13b - reviewed code and test (thanks @ryanofsky for adding the test). MarcoFalke: ACK 2276339a176f83ffe8ceefb3e41ecca8601aa13b 🎎 ryanofsky: Code review ACK 2276339a176f83ffe8ceefb3e41ecca8601aa13b. No change to bugfix, just rebased and new test commit added since last review Tree-SHA512: c1d68e7c681a45c6cadc84e407c2266bcb4b12d34264e1232a61c4eadb74b551231c5a3b1d041de39f507aef4dfa7d4589b8bfe1833f069c739c6270d2a05dbe Backport of Core [[bitcoin/bitcoin#18551 | PR18551]] Depends on D6653 Test Plan: `ninja check` Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Subscribers: deadalnix, Fabien Differential Revision: https://reviews.bitcoinabc.org/D6654
Summary: 13d2a33537a403ac47a989be92109d3214375b6a Fix unregister_all_during_call cleanup (Russell Yanofsky) Pull request description: Use `TestingSetup` fixture to fix `unregister_all_during_call` test not calling `UnregisterBackgroundSignalScheduler`, which could trigger an assert in `RegisterBackgroundSignalScheduler` when called in later tests Failure reported by fanquake bitcoin/bitcoin#18551 (comment) ACKs for top commit: MarcoFalke: ACK 13d2a33537a403ac47a989be92109d3214375b6a if appveyor unit tests pass Tree-SHA512: d2ec8ff14c54d97903af50031abfac1f38ec1c3aabc90371cfd5b79481fa69d3d77f339bfdf7d2178fd85e83402f72eda7cf4d339e5bbfa7e6e1a68836643b93 Backport of Core [[bitcoin/bitcoin#18563 | PR18563]] Depends on D6654 Test Plan: `ninja check` Reviewers: #bitcoin_abc, deadalnix Reviewed By: #bitcoin_abc, deadalnix Differential Revision: https://reviews.bitcoinabc.org/D6655
Bug in MainSignalsInstance::Clear could cause validation interface callbacks to be deleted during execution if UnregisterAllValidationInterfaces was called more than once. Bug was introduced in bitcoin/bitcoin#18524 and is fixed by bitcoin/bitcoin#18551
Use TestingSetup fixture to fix unregister_all_during_call test not calling UnregisterBackgroundSignalScheduler, which could trigger an assert in RegisterBackgroundSignalScheduler when called in later tests Failure reported by fanquake <[email protected]> bitcoin/bitcoin#18551 (comment)
Bug in MainSignalsInstance::Clear could cause validation interface callbacks to be deleted during execution if UnregisterAllValidationInterfaces was called more than once. Bug was introduced in bitcoin/bitcoin#18524 and is fixed by bitcoin/bitcoin#18551
Use TestingSetup fixture to fix unregister_all_during_call test not calling UnregisterBackgroundSignalScheduler, which could trigger an assert in RegisterBackgroundSignalScheduler when called in later tests Failure reported by fanquake <[email protected]> bitcoin/bitcoin#18551 (comment)
The previous code for MainSignalsInstance::Clear would decrement the reference
count of every interface, including ones that were already Unregister()ed but
still being executed.
This fixes the issue pointed out here: https://github.com/bitcoin/bitcoin/pull/18524/files#r404395685 . It's not currently observable.