<div dir="ltr">Our bots bark on this:<div><div>==2427==AddressSanitizer CHECK failed: build/llvm/projects/compiler-rt/lib/asan/asan_fake_stack.h:46 "((n_frames_)) < ((kMaxNumberOfFrames))" (0x3ff, 0x3ff)</div>
</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Apr 11, 2013 at 6:07 PM, Kostya Serebryany <span dir="ltr"><<a href="mailto:kcc@google.com" target="_blank">kcc@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: kcc<br>
Date: Thu Apr 11 09:07:02 2013<br>
New Revision: 179286<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=179286&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=179286&view=rev</a><br>
Log:<br>
[asan] make heavy_uar_test a bit more heavy and fix he fake stack to pass this test<br>
<br>
Modified:<br>
    compiler-rt/trunk/lib/asan/asan_fake_stack.h<br>
    compiler-rt/trunk/lib/asan/lit_tests/Linux/heavy_uar_test.cc<br>
<br>
Modified: compiler-rt/trunk/lib/asan/asan_fake_stack.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_fake_stack.h?rev=179286&r1=179285&r2=179286&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_fake_stack.h?rev=179286&r1=179285&r2=179286&view=diff</a><br>

==============================================================================<br>
--- compiler-rt/trunk/lib/asan/asan_fake_stack.h (original)<br>
+++ compiler-rt/trunk/lib/asan/asan_fake_stack.h Thu Apr 11 09:07:02 2013<br>
@@ -53,7 +53,7 @@ class FakeFrameLifo {<br>
   FakeFrame *top() {<br>
     if (n_frames_ == 0)<br>
       return 0;<br>
-    return frames_[n_frames_];<br>
+    return frames_[n_frames_ - 1];<br>
   }<br>
  private:<br>
   uptr n_frames_;<br>
<br>
Modified: compiler-rt/trunk/lib/asan/lit_tests/Linux/heavy_uar_test.cc<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/Linux/heavy_uar_test.cc?rev=179286&r1=179285&r2=179286&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/Linux/heavy_uar_test.cc?rev=179286&r1=179285&r2=179286&view=diff</a><br>

==============================================================================<br>
--- compiler-rt/trunk/lib/asan/lit_tests/Linux/heavy_uar_test.cc (original)<br>
+++ compiler-rt/trunk/lib/asan/lit_tests/Linux/heavy_uar_test.cc Thu Apr 11 09:07:02 2013<br>
@@ -7,6 +7,7 @@<br>
<br>
 #include <stdio.h><br>
 #include <string.h><br>
+#include <stdlib.h><br>
<br>
 __attribute__((noinline))<br>
 inline char *pretend_to_do_something(char *x) {<br>
@@ -24,7 +25,7 @@ char *LeakStack() {<br>
 __attribute__((noinline))<br>
 void RecuriveFunctionWithStackFrame(int depth) {<br>
   if (depth <= 0) return;<br>
-  char x[1000];<br>
+  char x[1024];<br>
   memset(x, 0, sizeof(x));<br>
   pretend_to_do_something(x);<br>
   RecuriveFunctionWithStackFrame(depth - 1);<br>
@@ -33,9 +34,11 @@ void RecuriveFunctionWithStackFrame(int<br>
<br>
 int main(int argc, char **argv) {<br>
   char *stale_stack = LeakStack();<br>
-  RecuriveFunctionWithStackFrame(10);<br>
-  RecuriveFunctionWithStackFrame(20);<br>
-  RecuriveFunctionWithStackFrame(30);<br>
+  int n_iter = argc >= 2 ? atoi(argv[1]) : 1000;<br>
+  int depth  = argc >= 3 ? atoi(argv[2]) : 1000;<br>
+  for (int i = 0; i < n_iter; i++) {<br>
+    RecuriveFunctionWithStackFrame(depth);<br>
+  }<br>
   stale_stack[100]++;<br>
   // CHECK: ERROR: AddressSanitizer: stack-use-after-return on address<br>
   // CHECK: is located in stack of thread T0 at offset 132 in frame<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div>Alexey Samsonov, MSK</div>
</div>