-
Notifications
You must be signed in to change notification settings - Fork 38.8k
fuzz: Fix assert bug in txorphan target #25624
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
|
|
shaavan
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.
Concept ACK
- The logic of code changes seems correct, and I agree with the reasoning that:
We can only guarantee tx will not be added if the orphanage already has it.
Though I wonder why this following assumption was initially made?
tx should already be added since it will not be too big in the test
- I looked through the file to confirm that the instances that should be added according to the
iwyu-tool, and I was able to confirm there addition except fortinyformat.h, as I could not find any use of offormat_errorin this file. - I have to further check whether the removal of
net.his correct or not. - It would help if you could share the link to the
iwyu-toolyou are currently using to do the testing.
|
@shaavan I made the wrong assumption that the tx will not be too big since I expect each tx will only have a few inputs/outputs. Before the PR got merged, I ran the fuzz target locally for 1 day and there was no crash. But OSS-Fuzz can produce a test case that can construct overweight tx with only a few bytes. For |
|
iwyu is run by the CI (https://cirrus-ci.com/task/5279630734131200?logs=ci#L7283): Which looks correct. |
|
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. |
|
lgtm ACK 2315830 |
2315830 fuzz: Fix assert bug in txorphan target (chinggg) Pull request description: Fix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=48914. It is possible to construct big tx that got rejected in `AddTx`, so we cannot assume tx will be added successfully. We can only guarantee tx will not be added if orphanage already has it. ACKs for top commit: MarcoFalke: lgtm ACK 2315830 Tree-SHA512: e173bc1a932639746de1192ed238e2e2318899f55371febb598facd0e811d8c54997f074f5e761757e1ffd3ae76d8edf9d673f020b2d97d5762ac656f632be81
d68ca4e Fix `-Wparentheses` gcc warning (Hennadii Stepanov) Pull request description: This PR fixes `-Wparentheses` gcc warning which has been introduced in bitcoin/bitcoin#25624. On the master branch (6d8707b): ``` $ gcc --version gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0 Copyright (C) 2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ make > /dev/null In file included from ./net.h:29, from ./net_processing.h:9, from test/fuzz/txorphan.cpp:7: test/fuzz/txorphan.cpp: In lambda function: test/fuzz/txorphan.cpp:116:70: warning: suggest parentheses around comparison in operand of ‘==’ [-Wparentheses] 116 | Assert(!have_tx == GetTransactionWeight(*tx) > MAX_STANDARD_TX_WEIGHT); | ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ ./util/check.h:74:50: note: in definition of macro ‘Assert’ 74 | #define Assert(val) inline_assertion_check<true>(val, __FILE__, __LINE__, __func__, #val) | ^~~ ``` ACKs for top commit: MarcoFalke: ACK d68ca4e Tree-SHA512: 5c98df4d6a6124d048b16eb3caf29bb396223d3394c1f48efc0fe0c8fd334d67dbf64d0b2e40faf9eda6f6a537885abcff05c61e410cfb317737e3dc361791ee
d68ca4e Fix `-Wparentheses` gcc warning (Hennadii Stepanov) Pull request description: This PR fixes `-Wparentheses` gcc warning which has been introduced in bitcoin#25624. On the master branch (6d8707b): ``` $ gcc --version gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0 Copyright (C) 2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ make > /dev/null In file included from ./net.h:29, from ./net_processing.h:9, from test/fuzz/txorphan.cpp:7: test/fuzz/txorphan.cpp: In lambda function: test/fuzz/txorphan.cpp:116:70: warning: suggest parentheses around comparison in operand of ‘==’ [-Wparentheses] 116 | Assert(!have_tx == GetTransactionWeight(*tx) > MAX_STANDARD_TX_WEIGHT); | ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ ./util/check.h:74:50: note: in definition of macro ‘Assert’ 74 | #define Assert(val) inline_assertion_check<true>(val, __FILE__, __LINE__, __func__, #val) | ^~~ ``` ACKs for top commit: MarcoFalke: ACK d68ca4e Tree-SHA512: 5c98df4d6a6124d048b16eb3caf29bb396223d3394c1f48efc0fe0c8fd334d67dbf64d0b2e40faf9eda6f6a537885abcff05c61e410cfb317737e3dc361791ee
Fix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=48914.
It is possible to construct big tx that got rejected in
AddTx, so we cannot assume tx will be added successfully. We can only guarantee tx will not be added if orphanage already has it.