<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jan 9, 2014 at 1:09 PM, Yury Gribov <span dir="ltr"><<a href="mailto:tetra2005@gmail.com" target="_blank">tetra2005@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>
<br>
================<br>
Comment at: asan/lit_tests/TestCases/printf-2.c:2<br>
@@ +1,3 @@<br>
+// RUN: %clang_asan -O2 %s -o %t<br>
+// RUN: not %t 2>&1 | FileCheck %s<br>
+<br>
----------------<br>
Yury Gribov wrote:<br>
> Yury Gribov wrote:<br>
> > Kostya Serebryany wrote:<br>
> > > please make these tests run in 3 modes:<br>
> > >   ASAN_OPTIONS=check_printf=0<br>
> > >   ASAN_OPTIONS=check_printf=1<br>
> > >   ASAN_OPTIONS=""<br>
> > ><br>
> > > we need to test that the flag affects the behavior and that it's default value is what we expect it to be.<br>
> > ><br>
> > > (use FileCheck --check-prefix=CHECK-ON and --check-prefix=CHECK-OFF)<br>
> > Ok.<br>
> BTW how do you suggest the check_printf=0 case? In my understanding we'll have UB with absolutely unpredictable behavior...<br>
> That's not that bad.<br>
> If you allocate a heap block using asan's allocator,<br>
> the behavior of an uncheck-ed out-of-bounds read is quite predictable<br>
<br>
</div>I tend to agree but e.g. GCC team tends to reject tests that trigger UB. Also things like this tend to be rather unstable with respect to glibc/kernel versions.<br></blockquote><div><br></div><div>If you run a test under asan and dereference a[4001] (where 'a' is a heap allocated block of 4000 bytes) glibc or kernel are not involved.</div>
<div>Such test is not supposed to run w/o asan, where it would indeed be bad. </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I'll do this if you're adamant though.<br></blockquote><div><br></div><div>In LLVM -- yes, please. </div><div>GCC has a different test suite anyway. </div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
<br>
<br>
<a href="http://llvm-reviews.chandlerc.com/D2480" target="_blank">http://llvm-reviews.chandlerc.com/D2480</a><br>
</blockquote></div><br></div></div>