<div dir="auto"><div>While I'm not an active LLVM dev at the moment, this piqued my interest.</div><div dir="auto"><br></div><div dir="auto">It looks like the interceptor function is trying to return a DWORD from CreateThread, where it should be returning a HANDLE (which is basically a void*, something I've exploited in the past for statically checking resource leaks & handle misuse). The C specific handler looks like the same thing, returning int instead of EXCEPTION_DISPOSITION. I bet that'd fix it.</div><div dir="auto"><br><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">On Fri, Apr 26, 2019, 4:10 PM Julian Lettner via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi,<div><br></div><div>I triggered a build failure on a Windows-sanitizer by making the sanity checking in `ASAN_INTERCEPT_FUNC` a bit stricter.</div><div>My best guess is that the type of the defined interceptor is not compatible (in C++ typing terms) with the “real” function.</div><div><br></div><div>This seems to be the case for the following 2 functions:</div><div><br></div><div>CreateThread “no conversion”:</div><div><div><font face="Courier New">From: 'DWORD (__cdecl *)(void * , __sanitizer::uptr, DWORD (__cdecl *)(void *), void *, DWORD, void * )'</font></div><div><font face="Courier New">To : 'HANDLE (__cdecl *)(LPSECURITY_ATTRIBUTES, SIZE_T , LPTHREAD_START_ROUTINE , LPVOID, DWORD, LPDWORD)'</font></div><div><font face="Courier New"><br></font></div><div>__C_specific_handler:</div><div><font face="Courier New">From: 'int (__cdecl *)(void * , void *, void * , void * )'</font></div><div><font face="Courier New">To: 'EXCEPTION_DISPOSITION</font><span style="font-family:"Courier New""> (__cdecl *)(_EXCEPTION_RECORD *, void *, _CONTEXT *, _DISPATCHER_CONTEXT *)'</span></div><div><br></div></div><div><br></div><div>Can someone on the Windows side take a quick look and revert my temporary fix?</div><div><br></div><div>Thanks!</div><div>Julian</div><div><br></div><div><br></div><div>Bot failure:</div><div><a href="http://lab.llvm.org:8011/builders/sanitizer-windows/builds/45049/steps/stage%201%20build/logs/stdio" target="_blank" rel="noreferrer">http://lab.llvm.org:8011/builders/sanitizer-windows/builds/45049/steps/stage%201%20build/logs/stdio</a></div><div><br></div><div>My temporary fix:</div><div><a href="https://github.com/llvm/llvm-project/commit/93c05f097a969666d48d67b8a658d5bc7e164478" target="_blank" rel="noreferrer">https://github.com/llvm/llvm-project/commit/93c05f097a969666d48d67b8a658d5bc7e164478</a></div><div><br></div><div><br></div><div><div><br></div></div></div>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" rel="noreferrer">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div></div></div>