[PATCH] D64085: [GWP-ASan] [Scudo] Add GWP-ASan backtrace for alloc/free to Scudo.

Mitch Phillips via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 2 13:33:43 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL364966: [GWP-ASan] [Scudo] Add GWP-ASan backtrace for alloc/free to Scudo. (authored by hctim, committed by ).
Herald added a subscriber: delcypher.

Changed prior to commit:
  https://reviews.llvm.org/D64085?vs=207584&id=207617#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64085/new/

https://reviews.llvm.org/D64085

Files:
  compiler-rt/trunk/lib/scudo/CMakeLists.txt
  compiler-rt/trunk/lib/scudo/scudo_allocator.cpp


Index: compiler-rt/trunk/lib/scudo/CMakeLists.txt
===================================================================
--- compiler-rt/trunk/lib/scudo/CMakeLists.txt
+++ compiler-rt/trunk/lib/scudo/CMakeLists.txt
@@ -12,6 +12,10 @@
 append_list_if(COMPILER_RT_HAS_LIBRT rt SCUDO_MINIMAL_DYNAMIC_LIBS)
 append_list_if(COMPILER_RT_HAS_LIBPTHREAD pthread SCUDO_MINIMAL_DYNAMIC_LIBS)
 append_list_if(COMPILER_RT_HAS_LIBLOG log SCUDO_MINIMAL_DYNAMIC_LIBS)
+append_list_if(COMPILER_RT_HAS_OMIT_FRAME_POINTER_FLAG -fno-omit-frame-pointer
+               SCUDO_CFLAGS)
+append_list_if(COMPILER_RT_HAS_OMIT_FRAME_POINTER_FLAG
+               -mno-omit-leaf-frame-pointer SCUDO_CFLAGS)
 
 set(SCUDO_DYNAMIC_LINK_FLAGS ${SANITIZER_COMMON_LINK_FLAGS})
 # Use gc-sections by default to avoid unused code being pulled in.
@@ -35,7 +39,8 @@
   # Currently, Scudo uses the GwpAsan flag parser. This backs onto the flag
   # parsing mechanism of sanitizer_common. Once Scudo has its own flag parsing,
   # and parses GwpAsan options, you can remove this dependency.
-  list(APPEND SCUDO_MINIMAL_OBJECT_LIBS RTGwpAsan RTGwpAsanOptionsParser)
+  list(APPEND SCUDO_MINIMAL_OBJECT_LIBS RTGwpAsan RTGwpAsanOptionsParser
+                                        RTGwpAsanBacktraceLibc)
   list(APPEND SCUDO_CFLAGS -DGWP_ASAN_HOOKS)
 endif()
 
Index: compiler-rt/trunk/lib/scudo/scudo_allocator.cpp
===================================================================
--- compiler-rt/trunk/lib/scudo/scudo_allocator.cpp
+++ compiler-rt/trunk/lib/scudo/scudo_allocator.cpp
@@ -27,6 +27,7 @@
 
 #ifdef GWP_ASAN_HOOKS
 # include "gwp_asan/guarded_pool_allocator.h"
+# include "gwp_asan/optional/backtrace.h"
 # include "gwp_asan/optional/options_parser.h"
 #endif // GWP_ASAN_HOOKS
 
@@ -671,7 +672,10 @@
   Instance.init();
 #ifdef GWP_ASAN_HOOKS
   gwp_asan::options::initOptions();
-  GuardedAlloc.init(gwp_asan::options::getOptions());
+  gwp_asan::options::Options &Opts = gwp_asan::options::getOptions();
+  Opts.Backtrace = gwp_asan::options::getBacktraceFunction();
+  Opts.PrintBacktrace = gwp_asan::options::getPrintBacktraceFunction();
+  GuardedAlloc.init(Opts);
 #endif // GWP_ASAN_HOOKS
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64085.207617.patch
Type: text/x-patch
Size: 2177 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190702/9949f1bf/attachment.bin>


More information about the llvm-commits mailing list