[PATCH] D25946: [compiler-rt][asan] Add support for desallocation of unhandled pointers

Etienne Bergeron via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 25 09:51:44 PDT 2016


etienneb added inline comments.


================
Comment at: lib/asan/asan_allocator.cc:555
+    // coverage.
+    if (!get_allocator().PointerIsMine(ptr))
+      return;
----------------
rnk wrote:
> IMO it's a bug if we get here and !PointerIsMine. The primary allocator check is pretty fast, but checking the secondary allocator is a linear search I think.
> 
> We can probably move this check to the HeapFree interceptor in asan_malloc_win.cc if we need it, though. That's probably only called by the CRT, which isn't usually hot. It also keeps Windows heap interception concerns out of the main allocator logic.
Do we consider full coverage (catching every allocations) or not.

If not, then this make sense and we may need to figure out efficient way to run this test.

If we assume full coverage, then we should at least add a DCHECK here.
This is really error prone.

On windows, it's pretty hard to guarantee full coverage. Dynamic loading of DLL and the operating system may play in your back often.
I''m not convince which way is the best.

At least, we should make some benchmark on this.




https://reviews.llvm.org/D25946





More information about the llvm-commits mailing list