-
Notifications
You must be signed in to change notification settings - Fork 120
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] Fix quarantined memory and related info not release when context is released. #2505
base: main
Are you sure you want to change the base?
[DeviceASAN] Fix quarantined memory and related info not release when context is released. #2505
Conversation
Please sync these fix to msan as well. |
Sync some fixes to msan. |
if (IsFromQuarantined) { | ||
getContext()->logger.info("Quarantine Free: {}", | ||
(void *)AI->AllocBegin); | ||
} else { | ||
getContext()->logger.info("Free: {}", (void *)AI->AllocBegin); | ||
} |
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 feel not comfortable that "IsFromQuarantined" is just for different logger, it'd be better to move logger before calling "releaseAllocationNoCheck".
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.
That is just a helper function to reduce duplicated codes. If we split that logic to caller, then we would have to repeat the same code in different places, which is quite again the purpose of the function.
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 mean you can just move "getContext()->logger" before calling this function.
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 mean you can just move "getContext()->logger" before calling this function.
Yes, that is what I mean. If we move that logging logic to caller to this help function, then we would have duplicated codes.
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.
Got 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
Changes:
char*
instead ofvoid*
, this would make the logger try to print string instead of address, which leads to SEGV since they are not really strings.Quarantine
to use shared_ptr instead of the iterator to avoid invalid iterator.releaseAllocationNoCheck
to help better do allocation release.Intel/llvm PR: intel/llvm#16467