<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><span class="line" style="white-space: pre-wrap; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;">I added the the following comment to the chromium bug tracker. I apologize for all the extra work. :(</span><div class=""><font color="#000000" face="Roboto, Noto, sans-serif" size="2" class=""><span style="caret-color: rgb(0, 0, 0); white-space: pre-wrap;" class=""><br class=""></span></font><div class=""><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;" class=""><span class="line" style="white-space: pre-wrap; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;">My best guess agrees with comment #2 above: before we were never doing `&func`, but now we do (in ASAN_INTERCEPT_FUNC).</span><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;" class=""><span class="line" style="white-space: pre-wrap; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;">As a temporary workaround, I think using INTERCEPT_FUNCTION should work instead of ASAN_INTERCEPT_FUNC.</span></div><div class=""><span class="line" style="white-space: pre-wrap; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;">Similar to here: </span><font face="Roboto, Noto, sans-serif" size="2" class=""><a href="https://github.com/llvm/llvm-project/commit/93c05f097a969666d48d67b8a658d5bc7e164478" class="">https://github.com/llvm/llvm-project/commit/93c05f097a969666d48d67b8a658d5bc7e164478</a></font></div><div class=""><span class="line" style="white-space: pre-wrap; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;">(Thanks to Reid for cleaning up the fixme!)</span><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;" class=""><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;" class=""><span class="line" style="white-space: pre-wrap; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;">However, similar to above I *think* that the change could have uncovered a small discrepancy: We are creating a `_except_handler4_common` interceptor, but there is no `_except_handler4_common` original function.</span><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;" class=""><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;" class=""><span class="line" style="white-space: pre-wrap; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;">I think it is because the following two #if's predicate on different things (ASAN_DYNAMIC vs. ! _WIN64):</span><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;" class=""><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;" class=""><span class="line" style="white-space: pre-wrap; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;">```</span><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;" class=""><span class="line" style="white-space: pre-wrap; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;">#if ASAN_DYNAMIC</span><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;" class=""><span class="line" style="white-space: pre-wrap; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;">// This handler is named differently in -MT and -MD CRTs.</span><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;" class=""><span class="line" style="white-space: pre-wrap; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;">#define _except_handler4 _except_handler4_common</span><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;" class=""><span class="line" style="white-space: pre-wrap; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;">#endif</span><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;" class=""><span class="line" style="white-space: pre-wrap; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;">INTERCEPTOR(int, _except_handler4, void *a, void *b, void *c, void *d) {</span><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;" class=""><span class="line" style="white-space: pre-wrap; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;"> CHECK(REAL(_except_handler4));</span><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;" class=""><span class="line" style="white-space: pre-wrap; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;"> __asan_handle_no_return();</span><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;" class=""><span class="line" style="white-space: pre-wrap; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;"> return REAL(_except_handler4)(a, b, c, d);</span><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;" class=""><span class="line" style="white-space: pre-wrap; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;">}</span><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;" class=""><span class="line" style="white-space: pre-wrap; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;">#endif</span><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;" class=""><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;" class=""><span class="line" style="white-space: pre-wrap; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;">...</span><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;" class=""><span class="line" style="white-space: pre-wrap; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;">__tsan::InitializePlatformInterceptors():</span><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;" class=""><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;" class=""><span class="line" style="white-space: pre-wrap; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;">#ifdef _WIN64</span><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;" class=""><span class="line" style="white-space: pre-wrap; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;"> ASAN_INTERCEPT_FUNC(__C_specific_handler);</span><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;" class=""><span class="line" style="white-space: pre-wrap; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;">#else</span><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;" class=""><span class="line" style="white-space: pre-wrap; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;"> ASAN_INTERCEPT_FUNC(_except_handler3);</span><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;" class=""><span class="line" style="white-space: pre-wrap; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;"> ASAN_INTERCEPT_FUNC(_except_handler4);</span><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;" class=""><span class="line" style="white-space: pre-wrap; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;">#endif</span><br style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;" class=""><span class="line" style="white-space: pre-wrap; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Roboto, Noto, sans-serif; font-size: 13px;">```</span><div class=""><font color="#000000" face="Roboto, Noto, sans-serif" size="2" class=""><span style="caret-color: rgb(0, 0, 0); white-space: pre-wrap;" class=""><span class="Apple-tab-span" style="white-space:pre"> </span><br class=""></span></font><div><br class=""><blockquote type="cite" class=""><div class="">On Apr 30, 2019, at 7:51 AM, Hans Wennborg <<a href="mailto:hans@chromium.org" class="">hans@chromium.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">The 32-bit windows dynamic asan runtime build is still broken, see <a href="https://bugs.chromium.org/p/chromium/issues/detail?id=957971" class="">https://bugs.chromium.org/p/chromium/issues/detail?id=957971</a></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Apr 26, 2019 at 7:27 PM Julian Lettner via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Author: yln<br class="">
Date: Fri Apr 26 10:29:22 2019<br class="">
New Revision: 359325<br class="">
<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=359325&view=rev" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project?rev=359325&view=rev</a><br class="">
Log:<br class="">
[NFC][Sanitizer] Change "return type" of INTERCEPT_FUNCTION to void<br class="">
<br class="">
This temporary change tells us about all the places where the return<br class="">
value of the INTERCEPT_FUNCTION macro is actually used. In the next<br class="">
patch I will cleanup the macro and remove GetRealFuncAddress.<br class="">
<br class="">
Reviewed By: vitalybuka<br class="">
<br class="">
Differential Revision: <a href="https://reviews.llvm.org/D61145" rel="noreferrer" target="_blank" class="">https://reviews.llvm.org/D61145</a><br class="">
<br class="">
Modified:<br class="">
compiler-rt/trunk/lib/asan/asan_interceptors.h<br class="">
compiler-rt/trunk/lib/interception/interception_linux.h<br class="">
compiler-rt/trunk/lib/msan/<a href="http://msan_interceptors.cc" class="">msan_interceptors.cc</a><br class="">
<br class="">
Modified: compiler-rt/trunk/lib/asan/asan_interceptors.h<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_interceptors.h?rev=359325&r1=359324&r2=359325&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_interceptors.h?rev=359325&r1=359324&r2=359325&view=diff</a><br class="">
==============================================================================<br class="">
--- compiler-rt/trunk/lib/asan/asan_interceptors.h (original)<br class="">
+++ compiler-rt/trunk/lib/asan/asan_interceptors.h Fri Apr 26 10:29:22 2019<br class="">
@@ -122,12 +122,16 @@ DECLARE_REAL(char*, strstr, const char *<br class="">
#if !SANITIZER_MAC<br class="">
#define ASAN_INTERCEPT_FUNC(name) \<br class="">
do { \<br class="">
- if ((!INTERCEPT_FUNCTION(name) || !REAL(name))) \<br class="">
+ INTERCEPT_FUNCTION(name); \<br class="">
+ bool same = (& (name) == & WRAP(name)); \<br class="">
+ if ((!same || !REAL(name))) \<br class="">
VReport(1, "AddressSanitizer: failed to intercept '" #name "'\n"); \<br class="">
} while (0)<br class="">
#define ASAN_INTERCEPT_FUNC_VER(name, ver) \<br class="">
do { \<br class="">
- if ((!INTERCEPT_FUNCTION_VER(name, ver) || !REAL(name))) \<br class="">
+ INTERCEPT_FUNCTION_VER(name, ver); \<br class="">
+ name##_type ptr = (::__interception::real_##name); \<br class="">
+ if ((!ptr || !REAL(name))) \<br class="">
VReport( \<br class="">
1, "AddressSanitizer: failed to intercept '" #name "@@" #ver "'\n"); \<br class="">
} while (0)<br class="">
<br class="">
Modified: compiler-rt/trunk/lib/interception/interception_linux.h<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/interception/interception_linux.h?rev=359325&r1=359324&r2=359325&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/interception/interception_linux.h?rev=359325&r1=359324&r2=359325&view=diff</a><br class="">
==============================================================================<br class="">
--- compiler-rt/trunk/lib/interception/interception_linux.h (original)<br class="">
+++ compiler-rt/trunk/lib/interception/interception_linux.h Fri Apr 26 10:29:22 2019<br class="">
@@ -30,16 +30,18 @@ void *GetFuncAddrVer(const char *name, c<br class="">
} // namespace __interception<br class="">
<br class="">
#define INTERCEPT_FUNCTION_LINUX_OR_FREEBSD(func) \<br class="">
- ::__interception::GetRealFunctionAddress( \<br class="">
+ do { ::__interception::GetRealFunctionAddress( \<br class="">
#func, (::__interception::uptr *)&__interception::PTR_TO_REAL(func), \<br class="">
(::__interception::uptr) & (func), \<br class="">
- (::__interception::uptr) & WRAP(func))<br class="">
+ (::__interception::uptr) & WRAP(func)); \<br class="">
+ } while (0) // TODO(yln): temporarily make macro void.<br class="">
<br class="">
// Android, Solaris and OpenBSD do not have dlvsym<br class="">
#if !SANITIZER_ANDROID && !SANITIZER_SOLARIS && !SANITIZER_OPENBSD<br class="">
#define INTERCEPT_FUNCTION_VER_LINUX_OR_FREEBSD(func, symver) \<br class="">
- (::__interception::real_##func = (func##_type)( \<br class="">
- unsigned long)::__interception::GetFuncAddrVer(#func, symver))<br class="">
+ do { (::__interception::real_##func = (func##_type)( \<br class="">
+ unsigned long)::__interception::GetFuncAddrVer(#func, symver)); \<br class="">
+ } while (0)<br class="">
#else<br class="">
#define INTERCEPT_FUNCTION_VER_LINUX_OR_FREEBSD(func, symver) \<br class="">
INTERCEPT_FUNCTION_LINUX_OR_FREEBSD(func)<br class="">
<br class="">
Modified: compiler-rt/trunk/lib/msan/<a href="http://msan_interceptors.cc" class="">msan_interceptors.cc</a><br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/msan_interceptors.cc?rev=359325&r1=359324&r2=359325&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/msan_interceptors.cc?rev=359325&r1=359324&r2=359325&view=diff</a><br class="">
==============================================================================<br class="">
--- compiler-rt/trunk/lib/msan/<a href="http://msan_interceptors.cc" class="">msan_interceptors.cc</a> (original)<br class="">
+++ compiler-rt/trunk/lib/msan/<a href="http://msan_interceptors.cc" class="">msan_interceptors.cc</a> Fri Apr 26 10:29:22 2019<br class="">
@@ -1243,13 +1243,17 @@ int OnExit() {<br class="">
<br class="">
#define MSAN_INTERCEPT_FUNC(name) \<br class="">
do { \<br class="">
- if ((!INTERCEPT_FUNCTION(name) || !REAL(name))) \<br class="">
+ INTERCEPT_FUNCTION(name); \<br class="">
+ bool same = (& (name) == & WRAP(name)); \<br class="">
+ if ((!same || !REAL(name))) \<br class="">
VReport(1, "MemorySanitizer: failed to intercept '" #name "'\n"); \<br class="">
} while (0)<br class="">
<br class="">
#define MSAN_INTERCEPT_FUNC_VER(name, ver) \<br class="">
do { \<br class="">
- if ((!INTERCEPT_FUNCTION_VER(name, ver) || !REAL(name))) \<br class="">
+ INTERCEPT_FUNCTION_VER(name, ver); \<br class="">
+ name##_type ptr = (::__interception::real_##name); \<br class="">
+ if ((!ptr || !REAL(name))) \<br class="">
VReport( \<br class="">
1, "MemorySanitizer: failed to intercept '" #name "@@" #ver "'\n"); \<br class="">
} while (0)<br class="">
<br class="">
<br class="">
_______________________________________________<br class="">
llvm-commits mailing list<br class="">
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank" class="">llvm-commits@lists.llvm.org</a><br class="">
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank" class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br class="">
</blockquote></div></div>
</div></blockquote></div><br class=""></div></div></div></body></html>