-
Notifications
You must be signed in to change notification settings - Fork 997
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
HWSan on AARCH64 depends on the page size #1446
Comments
Using pagesize here would be wasteful - ex. on Android we default to a
single 4Kb page for the stack ring buffer. I'd rather replace the mmap in
SavedStackAllocations with InternalAlloc , this should solve the problem.
There is also an efficiency issue in HwasanThreadList::DontNeedThread - if
the buffer is smaller than a page, it will never be able to release
anything. That's a bit harder to fix, and I'm not sure how significant it
actually is.
…On Sat, Sep 18, 2021 at 5:51 PM Andrew Pinski ***@***.***> wrote:
From https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102144:
The RingBufferSize inside hwasan/hwasan_thread_list.h depends on the page
size being 4k. This does not work with 64k pages and most likely won't work
with 16k pages too.
This patch works for me with 64k page size but it really really be using
the pagesize rather than a hard coded #:
diff --git a/libsanitizer/hwasan/hwasan_thread_list.h
b/libsanitizer/hwasan/hwasan_thread_list.h
index 15916a802d6..c13c5910b95 100644
--- a/libsanitizer/hwasan/hwasan_thread_list.h
+++ b/libsanitizer/hwasan/hwasan_thread_list.h
@@ -57,7 +57,7 @@ static uptr RingBufferSize() {
// FIXME: increase the limit to 8 once this bug is fixed:
// https://bugs.llvm.org/show_bug.cgi?id=39030
for (int shift = 1; shift < 7; ++shift) {
- uptr size = 4096 * (1ULL << shift);
- uptr size = (64*4096) * (1ULL << shift);
if (size >= desired_bytes)
return size;
}
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1446>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADG4SWO3IYLJ4Z5PDKNBQDUCUX2TANCNFSM5EJX6BCA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
So this was fixed now via |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
From https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102144:
The RingBufferSize inside hwasan/hwasan_thread_list.h depends on the page size being 4k. This does not work with 64k pages and most likely won't work with 16k pages too.
This patch works for me with 64k page size but it really really be using the pagesize rather than a hard coded #:
The text was updated successfully, but these errors were encountered: