<div dir="ltr">Ryan,<div><br></div><div>This test breaks the bot:</div><div><a href="http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/24502">http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/24502</a><br></div><div><br></div><div><div>@@@BUILD_STEP run asan lit tests [arm/hammerhead-userdebug/LMY48T]@@@</div><div>+ echo @@@BUILD_STEP run asan lit tests '[arm/hammerhead-userdebug/LMY48T]@@@'</div><div>+ cd /mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/compiler_rt_build_android_arm</div><div>+ ninja check-asan</div><div>[1/1] Running the AddressSanitizer tests</div><div>-- Testing: 364 tests, 16 threads --</div><div>Testing: 0 .. 10.. 20.. </div><div>FAIL: AddressSanitizer-arm-android :: TestCases/Posix/global-registration.c (112 of 364)</div><div>******************** TEST 'AddressSanitizer-arm-android :: TestCases/Posix/global-registration.c' FAILED ********************</div><div>Script:</div><div>--</div><div>/mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/projects/compiler-rt/test/asan/android_commands/android_compile.py /mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm_build64/bin/clang -fsanitize=address -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only --target=armv7-linux-androideabi --sysroot=/mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/../../../android-ndk/standalone-arm/sysroot -B/mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/../../../android-ndk/standalone-arm -lm -shared-libasan -c -o /mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Posix/Output/global-registration.c.tmp-one.o -DDYNAMICLIB=\"/mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Posix/Output/<a href="http://global-registration.c.tmp-dynamic.so">global-registration.c.tmp-dynamic.so</a>\" -DMAIN_FILE /mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/projects/compiler-rt/test/asan/TestCases/Posix/global-registration.c</div><div>/mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/projects/compiler-rt/test/asan/android_commands/android_compile.py /mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm_build64/bin/clang -fsanitize=address -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only --target=armv7-linux-androideabi --sysroot=/mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/../../../android-ndk/standalone-arm/sysroot -B/mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/../../../android-ndk/standalone-arm -lm -shared-libasan -c -o /mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Posix/Output/global-registration.c.tmp-two.o -DSECONDARY_FILE /mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/projects/compiler-rt/test/asan/TestCases/Posix/global-registration.c</div><div>/mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/projects/compiler-rt/test/asan/android_commands/android_compile.py /mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm_build64/bin/clang -fsanitize=address -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only --target=armv7-linux-androideabi --sysroot=/mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/../../../android-ndk/standalone-arm/sysroot -B/mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/../../../android-ndk/standalone-arm -lm -shared-libasan -o /mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Posix/Output/global-registration.c.tmp /mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Posix/Output/global-registration.c.tmp-one.o /mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Posix/Output/global-registration.c.tmp-two.o</div><div>/mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/projects/compiler-rt/test/asan/android_commands/android_compile.py /mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm_build64/bin/clang -fsanitize=address -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only --target=armv7-linux-androideabi --sysroot=/mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/../../../android-ndk/standalone-arm/sysroot -B/mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/../../../android-ndk/standalone-arm -lm -shared-libasan -shared -fPIC -o /mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Posix/Output/<a href="http://global-registration.c.tmp-dynamic.so">global-registration.c.tmp-dynamic.so</a> -DSHARED_LIBRARY_FILE /mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/projects/compiler-rt/test/asan/TestCases/Posix/global-registration.c</div><div>not /mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Posix/Output/global-registration.c.tmp 1 2>&1 | FileCheck --check-prefix ASAN-CHECK-1 /mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/projects/compiler-rt/test/asan/TestCases/Posix/global-registration.c</div><div>not /mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Posix/Output/global-registration.c.tmp 2 2>&1 | FileCheck --check-prefix ASAN-CHECK-2 /mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/projects/compiler-rt/test/asan/TestCases/Posix/global-registration.c</div><div>not /mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Posix/Output/global-registration.c.tmp 3 2>&1 | FileCheck --check-prefix ASAN-CHECK-3 /mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/projects/compiler-rt/test/asan/TestCases/Posix/global-registration.c</div><div>--</div><div>Exit Code: 2</div><div><br></div><div>Command Output (stderr):</div><div>--</div><div>clang-3.9: warning: -lm: 'linker' input unused</div><div>clang-3.9: warning: -lm: 'linker' input unused</div><div>FileCheck error: '-' is empty.</div><div>FileCheck command line: FileCheck --check-prefix ASAN-CHECK-3 /mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/projects/compiler-rt/test/asan/TestCases/Posix/global-registration.c</div><div><br></div><div>--</div><div><br></div><div>********************</div><div>Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. </div><div>Testing Time: 537.93s</div><div>********************</div><div>Failing Tests (1):</div><div> AddressSanitizer-arm-android :: TestCases/Posix/global-registration.c</div><div><br></div><div> Expected Passes : 165</div><div> Expected Failures : 40</div><div> Unsupported Tests : 158</div><div> Unexpected Failures: 1</div><div>FAILED: cd /mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/compiler_rt_build_android_arm/test/asan && /usr/bin/python2.7 /mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/utils/lit/lit.py -sv /mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig</div><div>ninja: build stopped: subcommand failed.</div><div>@@@STEP_FAILURE@@@</div><div>+ echo @@@STEP_FAILURE@@@</div><div>+ echo @@@BUILD_STEP run sanitizer_common tests '[arm/hammerhead-userdebug/LMY48T]@@@'</div><div><br></div><div><br></div><div>--------------------------------------------------------------------------------</div><div>started: Thu Jun 23 13:34:17 2016</div><div>ended: Thu Jun 23 15:20:10 2016</div><div>duration: 1 hrs, 45 mins, 53 secs</div></div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Jun 22, 2016 at 1:06 PM Ryan Govostes via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@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">Author: rgov<br>
Date: Wed Jun 22 14:59:10 2016<br>
New Revision: 273464<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=273464&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=273464&view=rev</a><br>
Log:<br>
[asan] Add a test case for global registration<br>
<br>
This test case checks that globals from all object files are being registered<br>
after they've been linked together. It also checks that globals from libraries<br>
loaded at runtime are registered.<br>
<br>
<br>
Added:<br>
compiler-rt/trunk/test/asan/TestCases/Posix/global-registration.c<br>
<br>
Added: compiler-rt/trunk/test/asan/TestCases/Posix/global-registration.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Posix/global-registration.c?rev=273464&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Posix/global-registration.c?rev=273464&view=auto</a><br>
==============================================================================<br>
--- compiler-rt/trunk/test/asan/TestCases/Posix/global-registration.c (added)<br>
+++ compiler-rt/trunk/test/asan/TestCases/Posix/global-registration.c Wed Jun 22 14:59:10 2016<br>
@@ -0,0 +1,56 @@<br>
+// Test that globals from different shared objects all get registered.<br>
+<br>
+// This source file is compiled into three different source object files. Each<br>
+// object file declares a global buffer. The first two are linked together, and<br>
+// the third is loaded at runtime. We make sure that out-of-bounds accesses<br>
+// are caught for all three buffers.<br>
+<br>
+// RUN: %clang_asan -c -o %t-one.o -DDYNAMICLIB=\"%t-dynamic.so\" -DMAIN_FILE %s<br>
+// RUN: %clang_asan -c -o %t-two.o -DSECONDARY_FILE %s<br>
+// RUN: %clang_asan -o %t %t-one.o %t-two.o<br>
+// RUN: %clang_asan -shared -o %t-dynamic.so -DSHARED_LIBRARY_FILE %s<br>
+// RUN: not %run %t 1 2>&1 | FileCheck --check-prefix ASAN-CHECK-1 %s<br>
+// RUN: not %run %t 2 2>&1 | FileCheck --check-prefix ASAN-CHECK-2 %s<br>
+// RUN: not %run %t 3 2>&1 | FileCheck --check-prefix ASAN-CHECK-3 %s<br>
+<br>
+#if MAIN_FILE<br>
+<br>
+#include <dlfcn.h><br>
+#include <stdlib.h><br>
+<br>
+extern char buffer2[1];<br>
+char buffer1[1] = { };<br>
+<br>
+int main(int argc, char *argv[]) {<br>
+ int n = atoi(argv[1]);<br>
+ if (n == 1) {<br>
+ buffer1[argc] = 0;<br>
+ // ASAN-CHECK-1: {{0x.* is located 1 bytes .* 'buffer1'}}<br>
+ } else if (n == 2) {<br>
+ buffer2[argc] = 0;<br>
+ // ASAN-CHECK-2: {{0x.* is located 1 bytes .* 'buffer2'}}<br>
+ } else if (n == 3) {<br>
+ void *handle = dlopen(DYNAMICLIB, RTLD_NOW);<br>
+ if (!handle)<br>
+ return 1;<br>
+<br>
+ char *buffer = (char *)dlsym(handle, "buffer3");<br>
+ if (!buffer)<br>
+ return 1;<br>
+<br>
+ buffer[argc] = 0;<br>
+ // ASAN-CHECK-3: {{0x.* is located 1 bytes .* 'buffer3'}}<br>
+ }<br>
+<br>
+ return 0;<br>
+}<br>
+<br>
+#elif SECONDARY_FILE<br>
+<br>
+char buffer2[1] = { };<br>
+<br>
+#elif SHARED_LIBRARY_FILE<br>
+<br>
+char buffer3[1] = { };<br>
+<br>
+#endif<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><div dir="ltr">-- <br></div><div data-smartmail="gmail_signature">Mike<br>Sent from phone</div>