[Bug sanitizer/91101] Possible performance regression in libasan with detect_stack_use_after_return=1

marxin at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jul 8 13:47:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91101

--- Comment #11 from Martin Liška <marxin at gcc dot gnu.org> ---
If I apply the following patch:

diff --git a/libsanitizer/asan/asan_fake_stack.cc
b/libsanitizer/asan/asan_fake_stack.cc
index 3140f9a2aeb..2034769161e 100644
--- a/libsanitizer/asan/asan_fake_stack.cc
+++ b/libsanitizer/asan/asan_fake_stack.cc
@@ -198,6 +198,9 @@ static FakeStack *GetFakeStackFast() {
 }

 ALWAYS_INLINE uptr OnMalloc(uptr class_id, uptr size) {
+  VReport(1, "T%d: OnMalloc called for size: %d\n",
+          GetCurrentTidOrInvalid(), size);
+
   FakeStack *fs = GetFakeStackFast();
   if (!fs) return 0;
   uptr local_stack;

I see a rapid change of calls of the function from 15381->2127789, where the
change is an allocation 64B:

OnMalloc called for size: 64


More information about the Gcc-bugs mailing list