<div dir="ltr"><div>Just tested it out, that test does indeed fail under the old PM at -O3 and even at -O2.</div><div><br></div>If the ASan pass runs after optimizations and is designed to detect undefined behavior at runtime, I don't see how it can be super reliable at higher optimization levels.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, May 13, 2020 at 12:39 PM David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">+some sanitizer/new pass manager folks<br><br><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, May 13, 2020 at 12:22 PM Arthur Eubanks via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>I've been trying to burn down the remaining sanitizer failures under the new pass manager. Right now I'm stuck on some ASan tests.</div><div><br></div><div>Some ASan tests run under -O1. There are a couple differences between the old and new pass managers under -O1, e.g. the old PM doesn't inline whereas the new PM does. The differences seem to cause some lifetime intrinsics to get stripped out (e.g. via SROA, InstCombine). It might be due to ASan specifically testing undefined behavior, and different optimizations run means different behavior. For a specific example, use-after-scope-dtor-order.cpp runs under -O1 and fails under the new PM because SROA strips out the lifetime intrinsics and by the time the ASan pass runs it doesn't find the lifetime intrinsics to add its own instrumentation.</div></div></blockquote><div><br>That, to me, sounds like a real bug in the optimizations/asan implementation if this choice fo optimizations makes the diagnosis go away. (is ASan able to diagnose the problem at -O3 (where I guess SROA and other things run) with the legacy pass manager?)<br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br></div><div>What's the proper way to resolve this? Run the tests under -O0? Change the passes pipeline under the new PM when ASan (and maybe other sanitizers) is detected?</div></div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div></div>
</blockquote></div>