<div dir="ltr"><div dir="ltr">The change seems to be causing these failures:<div><a href="https://ci.chromium.org/buildbot/chromium.clang/CrWinAsan/1785">https://ci.chromium.org/buildbot/chromium.clang/CrWinAsan/1785</a></div><div><br></div><div>I haven't had time to debug them, but we'll need to do something about them before we push clang for chromium again.</div></div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Nov 8, 2018 at 4:46 PM Reid Kleckner <<a href="mailto:rnk@google.com">rnk@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr">The problem exhibited itself in nacl browser_tests, which is probably the hardest part of Chrome to debug:<div><a href="https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/win-asan/1584" target="_blank">https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/win-asan/1584</a><br></div><div><br></div><div>I reapplied your change and tried to reproduce the failure, we'll see how it goes.</div></div></div><div dir="ltr"></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Nov 7, 2018 at 9:14 AM David Major <<a href="mailto:dmajor@mozilla.com" target="_blank">dmajor@mozilla.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Reid, is there anything I can do to help get this patch unstuck? Thanks!<br>
<br>
On Fri, Oct 5, 2018 at 2:30 PM Reid Kleckner <<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>> wrote:<br>
><br>
> This looks like it's still breaking a pile of pnacl tests:<br>
> <a href="https://ci.chromium.org/buildbot/chromium.clang/CrWinAsan/1411" rel="noreferrer" target="_blank">https://ci.chromium.org/buildbot/chromium.clang/CrWinAsan/1411</a><br>
><br>
> This revision is in the compiler revision range for two separate bots causing the same set of tests to fail for multiple asan configs, so I'm confident that it's related. I'm going to revert for now and then try to come up with a test case for it that we can commit upstream. That will likely happen next week.<br>
><br>
> On Tue, Oct 2, 2018 at 10:18 AM David Major via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br>
>><br>
>> Author: dmajor<br>
>> Date: Tue Oct  2 10:17:12 2018<br>
>> New Revision: 343606<br>
>><br>
>> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=343606&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=343606&view=rev</a><br>
>> Log:<br>
>> Reland r342652 "[winasan] Unpoison the stack in NtTerminateThread"<br>
>><br>
>> In long-running builds we've seen some ASan complaints during thread creation that we suspect are due to leftover poisoning from previous threads whose stacks occupied that memory. This patch adds a hook that unpoisons the stack just before the NtTerminateThread syscall.<br>
>><br>
>> Differential Revision: <a href="https://reviews.llvm.org/D52091" rel="noreferrer" target="_blank">https://reviews.llvm.org/D52091</a><br>
>><br>
>><br>
>> Modified:<br>
>>     compiler-rt/trunk/lib/asan/asan_win.cc<br>
>>     compiler-rt/trunk/test/asan/TestCases/Windows/dll_host.cc<br>
>><br>
>> Modified: compiler-rt/trunk/lib/asan/asan_win.cc<br>
>> URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_win.cc?rev=343606&r1=343605&r2=343606&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_win.cc?rev=343606&r1=343605&r2=343606&view=diff</a><br>
>> ==============================================================================<br>
>> --- compiler-rt/trunk/lib/asan/asan_win.cc (original)<br>
>> +++ compiler-rt/trunk/lib/asan/asan_win.cc Tue Oct  2 10:17:12 2018<br>
>> @@ -154,6 +154,14 @@ INTERCEPTOR_WINAPI(DWORD, CreateThread,<br>
>>                              asan_thread_start, t, thr_flags, tid);<br>
>>  }<br>
>><br>
>> +INTERCEPTOR_WINAPI(LONG, NtTerminateThread, HANDLE handle, LONG status) {<br>
>> +  // Unpoison the terminating thread's stack because the memory may be re-used.<br>
>> +  NT_TIB *tib = (NT_TIB *)NtCurrentTeb();<br>
>> +  uptr stackSize = (uptr)tib->StackBase - (uptr)tib->StackLimit;<br>
>> +  __asan_unpoison_memory_region(tib->StackLimit, stackSize);<br>
>> +  return REAL(NtTerminateThread(handle, status));<br>
>> +}<br>
>> +<br>
>>  // }}}<br>
>><br>
>>  namespace __asan {<br>
>> @@ -169,7 +177,9 @@ void InitializePlatformInterceptors() {<br>
>><br>
>>    ASAN_INTERCEPT_FUNC(CreateThread);<br>
>>    ASAN_INTERCEPT_FUNC(SetUnhandledExceptionFilter);<br>
>> -<br>
>> +  CHECK(::__interception::OverrideFunction("NtTerminateThread",<br>
>> +                                           (uptr)WRAP(NtTerminateThread),<br>
>> +                                           (uptr *)&REAL(NtTerminateThread)));<br>
>>  #ifdef _WIN64<br>
>>    ASAN_INTERCEPT_FUNC(__C_specific_handler);<br>
>>  #else<br>
>><br>
>> Modified: compiler-rt/trunk/test/asan/TestCases/Windows/dll_host.cc<br>
>> URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Windows/dll_host.cc?rev=343606&r1=343605&r2=343606&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Windows/dll_host.cc?rev=343606&r1=343605&r2=343606&view=diff</a><br>
>> ==============================================================================<br>
>> --- compiler-rt/trunk/test/asan/TestCases/Windows/dll_host.cc (original)<br>
>> +++ compiler-rt/trunk/test/asan/TestCases/Windows/dll_host.cc Tue Oct  2 10:17:12 2018<br>
>> @@ -29,6 +29,7 @@<br>
>>  // IMPORT: __asan_wrap_HeapReAlloc<br>
>>  // IMPORT: __asan_wrap_HeapSize<br>
>>  // IMPORT: __asan_wrap_CreateThread<br>
>> +// IMPORT: __asan_wrap_NtTerminateThread<br>
>>  // IMPORT: __asan_wrap_RaiseException<br>
>>  // IMPORT: __asan_wrap_RtlRaiseException<br>
>>  // IMPORT: __asan_wrap_SetUnhandledExceptionFilter<br>
>><br>
>><br>
>> _______________________________________________<br>
>> llvm-commits mailing list<br>
>> <a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
>> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>
</blockquote></div>