[PATCH] D43702: [asan] Fix bug where suppression of overlapping accesses was ignored.

Kuba (Brecka) Mracek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 26 10:56:21 PST 2018

kubamracek added inline comments.

Comment at: lib/asan/asan_interceptors_memintrinsics.h:144
+          HaveStackTraceBasedSuppressions() && IsStackTraceSuppressed(&stack); \
+      if (!suppressed) {                                                       \
+        ReportStringFunctionMemoryRangesOverlap(name, offset1, length1,        \
delcypher wrote:
> kubamracek wrote:
> > Can we also check for suppressions based on interceptor name? See `ACCESS_MEMORY_RANGE` above, which is attempting suppressions both by name and by stacktrace.
> `ACCESS_MEMORY_RANGE` has access to a `ctx` object. Where do I get that from?
I think we can pass `ctx` from the caller(s), all the callers already seem to have it. Or we can use `name` directly here, but actually removing it in favor of `ctx` sounds better to me.

Comment at: test/asan/TestCases/strncpy-overlap.cc:29
+  // CHECK: [{{0x.*,[ ]*0x.*}}) and [{{0x.*,[ ]*0x.*}}) overlap
+  // CHECK-Linux: {{#0 0x.* in .*strncpy}}
+  // CHECK-Darwin: {{#0 0x.* in wrap_strncpy}}
delcypher wrote:
> kubamracek wrote:
> > Since the "Linux" line is matching the Darwin output as well, can we just use the Linux version?
> We could do. I think I copied the regex from the existing in `strncpy-overflow.cc` test. Is that test a bad example of how to do things?
It's not a big deal, but it just seems unnecessary to complicate this test with OS specific checks.

  rCRT Compiler Runtime


More information about the llvm-commits mailing list