[PATCH] D61145: [NFC][Sanitizer] Change "return type" of INTERCEPT_FUNCTION to void

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 30 13:59:50 PDT 2019


rnk added inline comments.


================
Comment at: compiler-rt/trunk/lib/asan/asan_interceptors.h:125-127
+    INTERCEPT_FUNCTION(name);                                            \
+    bool same = (& (name) == & WRAP(name));                              \
+    if ((!same || !REAL(name)))                                          \
----------------
yln wrote:
> vitalybuka wrote:
> > rnk wrote:
> > > I don't think this change is functionally correct on Windows. The interception mechanism on Windows is based on hotpatching, so the address comparison will always fail. This has created a minor regression in that now any asanified binary run with ASAN_OPTIONS=verbosity=1 emits "failed to intercept *" for every asan-specific interceptor. Checking the reteurn value was the correct thing to do for Windows. I want to revert this, WDYT?
> > Oh, I forgot about windows that didn't noticed that the check moved from LINUX_OR_FREEBSD into everything.
> > I guess it should be fine to revert it. but  this needs to be reverted as well D61205
> > I guess yln@ is in different timezone.
> Can we try to fix this for Windows instead of reverting altogether. I will provide a patch asap.
The revert became rL359611. I can help review any relanding, but I'm not sure why we'd want INTERCEPT_FUNCTION to return void in the first place, it seems best to have some way to signal failure. Interception is inherently quite prone to failure, and a return value seems like the best, most portable way to signal that.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D61145





More information about the llvm-commits mailing list