-
Notifications
You must be signed in to change notification settings - Fork 113
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
[DeviceAsan] Enlarge nullpointer redzone to better detect problem #2243
base: main
Are you sure you want to change the base?
[DeviceAsan] Enlarge nullpointer redzone to better detect problem #2243
Conversation
@@ -16,6 +16,8 @@ | |||
#include "common.hpp" | |||
#include <unordered_set> | |||
|
|||
#define NULLPTR_REDZONE_SIZE (4096) |
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.
add a comment about why choose this size
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.
this macro needn't be in header file, and I suggest using constexpr to define this constant
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.
I choose this size becuase it is a common page value, and I don't have any other good reasons for it.
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.
You can query the size of page by GetVirtualMemGranularity.
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.
I don't think that is necessary. Even when we have the page size, how many pages should we use? I think some simple value is good enough for now.
Also, this value don't have to align with any page size, that is not such requirement for it.
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.
lgtm
Also, print out the triggering address in the error report.