<div dir="ltr"><div><div>Hi,<br><br></div>I've very recently started looking at clang+ASan to sanitize my application. I discovered that the run time suppressions support added by <a href="http://reviews.llvm.org/D6280">http://reviews.llvm.org/D6280</a> does not suppress memcpy-param-overlap (and other *-param-overlap) errors. I want to suppress these errors from a library that I cannot recompile.<br><br>I looked at the code in asan_interceptors.cc and it seems to me that the suppressions mechanism used for ASAN_READ_RANGE and ASAN_WRITE_RANGE can easily be extended to CHECK_RANGES_OVERLAP. I made those code changes and recompiled clang and everything seems to be working as I expected. The essence of my changes is listed at the bottom of this email.<br><br></div><div>Is this change appropriate? If yes, what is the process to get this code committed?<br><br></div><div>Thanks and Regards,<br></div><div>Gaurav Malhotra<br></div><div><br></div><div>P.S. Here is the code change I made to CHECK_RANGES_OVERLAP. This was accompanied by changes to all the callers of this macro to pass the AsanInterceptorContext pointer that they already have. <br><br><span style="font-family:monospace,monospace">--- a/lib/asan/asan_interceptors.cc<br>+++ b/lib/asan/asan_interceptors.cc<br>@@ -82,13 +82,24 @@ static inline bool RangesOverlap(const char *offset1, uptr length1,<br>                                  const char *offset2, uptr length2) {<br>   return !((offset1 + length1 <= offset2) || (offset2 + length2 <= offset1));<br> }<br>-#define CHECK_RANGES_OVERLAP(name, _offset1, length1, _offset2, length2) do { \<br>+#define CHECK_RANGES_OVERLAP(ctx, name, _offset1, length1, _offset2, length2) do { \<br>   const char *offset1 = (const char*)_offset1; \<br>   const char *offset2 = (const char*)_offset2; \<br>   if (RangesOverlap(offset1, length1, offset2, length2)) { \<br>-    GET_STACK_TRACE_FATAL_HERE; \<br>-    ReportStringFunctionMemoryRangesOverlap(name, offset1, length1, \<br>-                                            offset2, length2, &stack); \<br>+      AsanInterceptorContext *_ctx = (AsanInterceptorContext *)ctx;     \<br>+      bool suppressed = false;                                          \<br>+      if (_ctx) {                                                       \<br>+        suppressed = IsInterceptorSuppressed(_ctx->interceptor_name);   \<br>+        if (!suppressed && HaveStackTraceBasedSuppressions()) {         \<br>+          GET_STACK_TRACE_FATAL_HERE;                                   \<br>+          suppressed = IsStackTraceSuppressed(&stack);                  \<br>+        }                                                               \<br>+      }                                                                 \<br>+      if (!suppressed) {                                                \<br>+        GET_STACK_TRACE_FATAL_HERE;                                     \<br>+        ReportStringFunctionMemoryRangesOverlap(name, offset1, length1, \<br>+                                             offset2, length2, &stack); \<br>+      }                                                                 \<br>   } \<br> } while (0)<br> </span><br><br></div></div>