-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Fix unsigned integer overflow in LoadMempool #24227
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
PastaPastaPasta
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.
utACK aaaae5349d1d5985081751c3a3b7386333d48cef, I reviewed the code, and agree it makes sense to merge
|
I've pushed a new version, which:
|
luke-jr
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.
utACK
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 fadcd03
Tried running below code to confirm:
uint64_t i = 4;
while (--i)
{
cout<<i;
}
cout<<i;
uint64_t i = 4;
while (i--)
{
cout<<i;
}
cout<<i;
uint64_t i = 4;
while (i)
{
--i;
cout<<i;
}
cout<<i;
It is also according to coding style mentioned in docs: https://github.com/bitcoin/bitcoin/blob/master/doc/developer-notes.md#coding-style-c
PastaPastaPasta
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.
Is the PR name really accurate, this can't overflow, maybe only underflow?
|
No idea, but the suppression is called |
I presume there are more |
|
Have you seen the pull request you commented on? #24196 (review) |
Ahh, thanks, I forgot they were related / about that PR |
fadcd03 Fix unsigned integer overflow in LoadMempool (MarcoFalke) Pull request description: It doesn't seem ideal to have an integer sanitizer enabled, but then disable it for the whole validation.cpp file. This removes one of the two violations. This should be a refactor. ACKs for top commit: prayank23: Code Review ACK bitcoin@fadcd03 Tree-SHA512: 9fb2f3d49008a59cd45b7c17be0c88c04e61183197c11c8176865af5532c8d0c940db49a351dd0fc75e1d7fd8678c3b816d34cfca170dc6b9cf8f37fdf1c8cae
fadcd03 Fix unsigned integer overflow in LoadMempool (MarcoFalke) Pull request description: It doesn't seem ideal to have an integer sanitizer enabled, but then disable it for the whole validation.cpp file. This removes one of the two violations. This should be a refactor. ACKs for top commit: prayank23: Code Review ACK bitcoin@fadcd03 Tree-SHA512: 9fb2f3d49008a59cd45b7c17be0c88c04e61183197c11c8176865af5532c8d0c940db49a351dd0fc75e1d7fd8678c3b816d34cfca170dc6b9cf8f37fdf1c8cae
fadcd03 Fix unsigned integer overflow in LoadMempool (MarcoFalke) Pull request description: It doesn't seem ideal to have an integer sanitizer enabled, but then disable it for the whole validation.cpp file. This removes one of the two violations. This should be a refactor. ACKs for top commit: prayank23: Code Review ACK bitcoin@fadcd03 Tree-SHA512: 9fb2f3d49008a59cd45b7c17be0c88c04e61183197c11c8176865af5532c8d0c940db49a351dd0fc75e1d7fd8678c3b816d34cfca170dc6b9cf8f37fdf1c8cae
Summary: This should have been backported before removing the ubsan suppression in D12821 This is a backport of [[bitcoin/bitcoin#24227 | core#24227]] Test Plan: `ninja all check-all` Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D12914
It doesn't seem ideal to have an integer sanitizer enabled, but then disable it for the whole validation.cpp file.
This removes one of the two violations.
This should be a refactor.