<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="">This change is causing the sanitizer lint checks to fail:<div class=""><br class=""></div><div class=""><span style="caret-color: rgb(51, 51, 51); color: rgb(51, 51, 51); font-family: monospace; font-size: 14px; white-space: pre-wrap;" class="">[81/95] Running lint check for sanitizer sources...
</span><a id="-87031640a1ca8a51-895e-46c6-af87-ce24fa4cd561" style="box-sizing: border-box; word-wrap: break-word; caret-color: rgb(51, 51, 51); color: rgb(51, 51, 51); font-family: monospace; font-size: 14px; white-space: pre-wrap; display: block; position: relative; top: -2em; visibility: hidden;" class=""></a><span title="Ninja target failed" style="box-sizing: border-box; font-family: monospace; font-size: 14px; white-space: pre-wrap; color: white; background-color: red;" class="">FAILED: lib/CMakeFiles/SanitizerLintCheck 
</span><span style="caret-color: rgb(51, 51, 51); color: rgb(51, 51, 51); font-family: monospace; font-size: 14px; white-space: pre-wrap;" class="">cd /Users/buildslave/jenkins/workspace/clang-stage1-configure-RA/clang-build/tools/clang/runtime/compiler-rt-bins/lib && env LLVM_CHECKOUT=/Users/buildslave/jenkins/workspace/clang-stage1-configure-RA/llvm SILENT=1 TMPDIR= PYTHON_EXECUTABLE=/usr/local/bin/python2.7 COMPILER_RT=/Users/buildslave/jenkins/workspace/clang-stage1-configure-RA/llvm/projects/compiler-rt /Users/buildslave/jenkins/workspace/clang-stage1-configure-RA/llvm/projects/compiler-rt/lib/sanitizer_common/scripts/check_lint.sh
/Users/buildslave/jenkins/workspace/clang-stage1-configure-RA/llvm/projects/<b class="">compiler-rt/lib/asan/<a href="http://asan_malloc_win.cc:345" class="">asan_malloc_win.cc:345</a>:  Lines should be <= 80 characters long</b>  [whitespace/line_length] [2]</span><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Jul 15, 2019, at 11:42 AM, Matthew G McGovern via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Author: mcgov<br class="">Date: Mon Jul 15 11:42:14 2019<br class="">New Revision: 366105<br class=""><br class="">URL: <a href="http://llvm.org/viewvc/llvm-project?rev=366105&view=rev" class="">http://llvm.org/viewvc/llvm-project?rev=366105&view=rev</a><br class="">Log:<br class="">[sanitizers][windows][mingw32] Mingw32 RTL fixes<br class="">RTL interception broke mingw32, this should fix those builds by<br class="">removing dependency on windows.h<br class=""><br class="">reviewed in <a href="https://reviews.llvm.org/D64694" class="">https://reviews.llvm.org/D64694</a><br class=""><br class="">Modified:<br class="">    compiler-rt/trunk/lib/asan/<a href="http://asan_malloc_win.cc" class="">asan_malloc_win.cc</a><br class=""><br class="">Modified: compiler-rt/trunk/lib/asan/<a href="http://asan_malloc_win.cc" class="">asan_malloc_win.cc</a><br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_malloc_win.cc?rev=366105&r1=366104&r2=366105&view=diff" class="">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_malloc_win.cc?rev=366105&r1=366104&r2=366105&view=diff</a><br class="">==============================================================================<br class="">--- compiler-rt/trunk/lib/asan/<a href="http://asan_malloc_win.cc" class="">asan_malloc_win.cc</a> (original)<br class="">+++ compiler-rt/trunk/lib/asan/<a href="http://asan_malloc_win.cc" class="">asan_malloc_win.cc</a> Mon Jul 15 11:42:14 2019<br class="">@@ -14,17 +14,12 @@<br class=""> #include "sanitizer_common/sanitizer_allocator_interface.h"<br class=""> #include "sanitizer_common/sanitizer_platform.h"<br class=""> #if SANITIZER_WINDOWS<br class="">-// Need to include defintions for windows heap api functions,<br class="">-// these assume windows.h will also be included. This definition<br class="">-// fixes an error that's thrown if you only include heapapi.h<br class="">-#if defined(_M_IX86)<br class="">-#define _X86_<br class="">-#elif defined(_M_AMD64)<br class="">-#define _AMD64_<br class="">-#else<br class="">-#error "Missing arch or unsupported platform for Windows."<br class="">-#endif<br class="">-#include <heapapi.h><br class="">+#include "asan_allocator.h"<br class="">+#include "asan_interceptors.h"<br class="">+#include "asan_internal.h"<br class="">+#include "asan_stack.h"<br class="">+#include "interception/interception.h"<br class="">+#include <stddef.h><br class=""><br class=""> // Intentionally not including windows.h here, to avoid the risk of<br class=""> // pulling in conflicting declarations of these functions. (With mingw-w64,<br class="">@@ -34,6 +29,9 @@ typedef void *HANDLE;<br class=""> typedef const void *LPCVOID;<br class=""> typedef void *LPVOID;<br class=""><br class="">+typedef unsigned long DWORD;<br class="">+constexpr unsigned long HEAP_ZERO_MEMORY = 0x00000008;<br class="">+constexpr unsigned long HEAP_REALLOC_IN_PLACE_ONLY = 0x00000010;<br class=""> constexpr unsigned long HEAP_ALLOCATE_SUPPORTED_FLAGS = (HEAP_ZERO_MEMORY);<br class=""> constexpr unsigned long HEAP_ALLOCATE_UNSUPPORTED_FLAGS =<br class="">     (~HEAP_ALLOCATE_SUPPORTED_FLAGS);<br class="">@@ -45,13 +43,16 @@ constexpr unsigned long HEAP_REALLOC_SUP<br class=""> constexpr unsigned long HEAP_REALLOC_UNSUPPORTED_FLAGS =<br class="">     (~HEAP_ALLOCATE_SUPPORTED_FLAGS);<br class=""><br class="">-#include "asan_allocator.h"<br class="">-#include "asan_interceptors.h"<br class="">-#include "asan_internal.h"<br class="">-#include "asan_stack.h"<br class="">-#include "interception/interception.h"<br class=""><br class="">-#include <stddef.h><br class="">+extern "C" {<br class="">+LPVOID WINAPI HeapAlloc(HANDLE hHeap, DWORD dwFlags, size_t dwBytes);<br class="">+LPVOID WINAPI HeapReAlloc(HANDLE hHeap, DWORD dwFlags, LPVOID lpMem,<br class="">+                         size_t dwBytes);<br class="">+BOOL WINAPI HeapFree(HANDLE hHeap, DWORD dwFlags, LPVOID lpMem);<br class="">+size_t WINAPI HeapSize(HANDLE hHeap, DWORD dwFlags, LPCVOID lpMem);<br class="">+<br class="">+BOOL WINAPI HeapValidate(HANDLE hHeap, DWORD dwFlags, LPCVOID lpMem);<br class="">+}<br class=""><br class=""> using namespace __asan;  // NOLINT<br class=""><br class="">@@ -160,7 +161,7 @@ void *_recalloc(void *p, size_t n, size_<br class="">   size_t old_size = _msize(p);<br class="">   void *new_alloc = malloc(size);<br class="">   if (new_alloc) {<br class="">-    REAL(memcpy)(new_alloc, p, Min(size, old_size));<br class="">+    REAL(memcpy)(new_alloc, p, Min<size_t>(size, old_size));<br class="">     if (old_size < size)<br class="">       REAL(memset)(((u8 *)new_alloc) + old_size, 0, size - old_size);<br class="">     free(p);<br class="">@@ -206,7 +207,7 @@ int _CrtSetReportMode(int, int) {<br class=""> #define OWNED_BY_RTL(heap, memory) \<br class="">   (!__sanitizer_get_ownership(memory) && HeapValidate(heap, 0, memory))<br class=""><br class="">-INTERCEPTOR_WINAPI(SIZE_T, HeapSize, HANDLE hHeap, DWORD dwFlags,<br class="">+INTERCEPTOR_WINAPI(size_t, HeapSize, HANDLE hHeap, DWORD dwFlags,<br class="">                    LPCVOID lpMem) {<br class="">   // If the RTL allocators are hooked we need to check whether the ASAN<br class="">   // allocator owns the pointer we're about to use. Allocations occur before<br class="">@@ -224,7 +225,7 @@ INTERCEPTOR_WINAPI(SIZE_T, HeapSize, HAN<br class=""> }<br class=""><br class=""> INTERCEPTOR_WINAPI(LPVOID, HeapAlloc, HANDLE hHeap, DWORD dwFlags,<br class="">-                   SIZE_T dwBytes) {<br class="">+                   size_t dwBytes) {<br class="">   // If the ASAN runtime is not initialized, or we encounter an unsupported<br class="">   // flag, fall back to the original allocator.<br class="">   if (flags()->windows_hook_rtl_allocators) {<br class="">@@ -269,14 +270,14 @@ INTERCEPTOR_WINAPI(BOOL, HeapFree, HANDL<br class=""> }<br class=""><br class=""> namespace __asan {<br class="">-using AllocFunction = LPVOID(WINAPI *)(HANDLE, DWORD, SIZE_T);<br class="">-using ReAllocFunction = LPVOID(WINAPI *)(HANDLE, DWORD, LPVOID, SIZE_T);<br class="">-using SizeFunction = SIZE_T(WINAPI *)(HANDLE, DWORD, LPVOID);<br class="">+using AllocFunction = LPVOID(WINAPI *)(HANDLE, DWORD, size_t);<br class="">+using ReAllocFunction = LPVOID(WINAPI *)(HANDLE, DWORD, LPVOID, size_t);<br class="">+using SizeFunction = size_t(WINAPI *)(HANDLE, DWORD, LPVOID);<br class=""> using FreeFunction = BOOL(WINAPI *)(HANDLE, DWORD, LPVOID);<br class=""><br class=""> void *SharedReAlloc(ReAllocFunction reallocFunc, SizeFunction heapSizeFunc,<br class="">                     FreeFunction freeFunc, AllocFunction allocFunc,<br class="">-                    HANDLE hHeap, DWORD dwFlags, LPVOID lpMem, SIZE_T dwBytes) {<br class="">+                    HANDLE hHeap, DWORD dwFlags, LPVOID lpMem, size_t dwBytes) {<br class="">   CHECK(reallocFunc && heapSizeFunc && freeFunc && allocFunc);<br class="">   GET_STACK_TRACE_MALLOC;<br class="">   GET_CURRENT_PC_BP_SP;<br class="">@@ -317,7 +318,7 @@ void *SharedReAlloc(ReAllocFunction real<br class="">           replacement_alloc = asan_malloc(dwBytes, &stack);<br class="">         if (replacement_alloc) {<br class="">           size_t old_size = heapSizeFunc(hHeap, dwFlags, lpMem);<br class="">-          if (old_size == ((SIZE_T)0) - 1) {<br class="">+          if (old_size == ((size_t)0) - 1) {<br class="">             asan_free(replacement_alloc, &stack, FROM_MALLOC);<br class="">             return nullptr;<br class="">           }<br class="">@@ -341,7 +342,7 @@ void *SharedReAlloc(ReAllocFunction real<br class="">       size_t old_usable_size = 0;<br class="">       if (replacement_alloc) {<br class="">         old_usable_size = asan_malloc_usable_size(lpMem, pc, bp);<br class="">-        REAL(memcpy)(replacement_alloc, lpMem, min(dwBytes, old_usable_size));<br class="">+        REAL(memcpy)(replacement_alloc, lpMem, Min<size_t>(dwBytes, old_usable_size));<br class="">         asan_free(lpMem, &stack, FROM_MALLOC);<br class="">       }<br class="">       return replacement_alloc;<br class="">@@ -388,7 +389,7 @@ void *SharedReAlloc(ReAllocFunction real<br class=""> }  // namespace __asan<br class=""><br class=""> INTERCEPTOR_WINAPI(LPVOID, HeapReAlloc, HANDLE hHeap, DWORD dwFlags,<br class="">-                   LPVOID lpMem, SIZE_T dwBytes) {<br class="">+                   LPVOID lpMem, size_t dwBytes) {<br class="">   return SharedReAlloc(REAL(HeapReAlloc), (SizeFunction)REAL(HeapSize),<br class="">                        REAL(HeapFree), REAL(HeapAlloc), hHeap, dwFlags, lpMem,<br class="">                        dwBytes);<br class="">@@ -399,28 +400,27 @@ INTERCEPTOR_WINAPI(LPVOID, HeapReAlloc,<br class=""> // allocations with detours and their definitions are unlikely to change.<br class=""> // Comments in /minkernel/ntos/rtl/heappublic.c indicate that these functions<br class=""> // are part of the heap's public interface.<br class="">-typedef ULONG LOGICAL;<br class="">+typedef unsigned long LOGICAL;<br class=""><br class=""> // This function is documented as part of the Driver Development Kit but *not*<br class=""> // the Windows Development Kit.<br class="">-NTSYSAPI LOGICAL RtlFreeHeap(PVOID HeapHandle, ULONG Flags,<br class="">-                             _Frees_ptr_opt_ PVOID BaseAddress);<br class="">+LOGICAL RtlFreeHeap(void* HeapHandle, DWORD Flags,<br class="">+                            void* BaseAddress);<br class=""><br class=""> // This function is documented as part of the Driver Development Kit but *not*<br class=""> // the Windows Development Kit.<br class="">-NTSYSAPI PVOID RtlAllocateHeap(PVOID HeapHandle, ULONG Flags, SIZE_T Size);<br class="">+void* RtlAllocateHeap(void* HeapHandle, DWORD Flags, size_t Size);<br class=""><br class=""> // This function is completely undocumented.<br class="">-PVOID<br class="">-RtlReAllocateHeap(PVOID HeapHandle, ULONG Flags, PVOID BaseAddress,<br class="">-                  SIZE_T Size);<br class="">+void*<br class="">+RtlReAllocateHeap(void* HeapHandle, DWORD Flags, void* BaseAddress,<br class="">+                  size_t Size);<br class=""><br class=""> // This function is completely undocumented.<br class="">-SIZE_T<br class="">-RtlSizeHeap(PVOID HeapHandle, ULONG Flags, PVOID BaseAddress);<br class="">+size_t RtlSizeHeap(void* HeapHandle, DWORD Flags, void* BaseAddress);<br class=""><br class="">-INTERCEPTOR_WINAPI(SIZE_T, RtlSizeHeap, HANDLE HeapHandle, ULONG Flags,<br class="">-                   PVOID BaseAddress) {<br class="">+INTERCEPTOR_WINAPI(size_t, RtlSizeHeap, HANDLE HeapHandle, DWORD Flags,<br class="">+                   void* BaseAddress) {<br class="">   if (!flags()->windows_hook_rtl_allocators ||<br class="">       UNLIKELY(!asan_inited || OWNED_BY_RTL(HeapHandle, BaseAddress))) {<br class="">     return REAL(RtlSizeHeap)(HeapHandle, Flags, BaseAddress);<br class="">@@ -430,8 +430,8 @@ INTERCEPTOR_WINAPI(SIZE_T, RtlSizeHeap,<br class="">   return asan_malloc_usable_size(BaseAddress, pc, bp);<br class=""> }<br class=""><br class="">-INTERCEPTOR_WINAPI(BOOL, RtlFreeHeap, HANDLE HeapHandle, ULONG Flags,<br class="">-                   PVOID BaseAddress) {<br class="">+INTERCEPTOR_WINAPI(BOOL, RtlFreeHeap, HANDLE HeapHandle, DWORD Flags,<br class="">+                   void* BaseAddress) {<br class="">   // Heap allocations happen before this function is hooked, so we must fall<br class="">   // back to the original function if the pointer is not from the ASAN heap, or<br class="">   // unsupported flags are provided.<br class="">@@ -445,8 +445,8 @@ INTERCEPTOR_WINAPI(BOOL, RtlFreeHeap, HA<br class="">   return true;<br class=""> }<br class=""><br class="">-INTERCEPTOR_WINAPI(PVOID, RtlAllocateHeap, HANDLE HeapHandle, DWORD Flags,<br class="">-                   SIZE_T Size) {<br class="">+INTERCEPTOR_WINAPI(void*, RtlAllocateHeap, HANDLE HeapHandle, DWORD Flags,<br class="">+                   size_t Size) {<br class="">   // If the ASAN runtime is not initialized, or we encounter an unsupported<br class="">   // flag, fall back to the original allocator.<br class="">   if (!flags()->windows_hook_rtl_allocators ||<br class="">@@ -467,8 +467,8 @@ INTERCEPTOR_WINAPI(PVOID, RtlAllocateHea<br class="">   return p;<br class=""> }<br class=""><br class="">-INTERCEPTOR_WINAPI(PVOID, RtlReAllocateHeap, HANDLE HeapHandle, ULONG Flags,<br class="">-                   PVOID BaseAddress, SIZE_T Size) {<br class="">+INTERCEPTOR_WINAPI(void*, RtlReAllocateHeap, HANDLE HeapHandle, DWORD Flags,<br class="">+                   void* BaseAddress, size_t Size) {<br class="">   // If it's actually a heap block which was allocated before the ASAN runtime<br class="">   // came up, use the real RtlFreeHeap function.<br class="">   if (!flags()->windows_hook_rtl_allocators)<br class=""><br class=""><br class="">_______________________________________________<br class="">llvm-commits mailing list<br class=""><a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a><br class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits<br class=""></div></div></blockquote></div><br class=""></div></body></html>