[compiler-rt] r263195 - Fix ASan test cases after r263177

Alexey Samsonov via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 11 10:13:18 PST 2016


I suspect that's because of different implementations of printf,
strcasestr, strstr in libc. These tests failed only on Android and Apple
platforms, where (apparently) these functions call strlen(), thus
triggering ASan interceptor.

On Fri, Mar 11, 2016 at 9:08 AM, Kostya Serebryany <kcc at google.com> wrote:

> do you know why this was not caught during manual testing before commit?
>
> On Thu, Mar 10, 2016 at 9:04 PM, Alexey Samsonov via llvm-commits <
> llvm-commits at lists.llvm.org> wrote:
>
>> Author: samsonov
>> Date: Thu Mar 10 23:04:49 2016
>> New Revision: 263195
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=263195&view=rev
>> Log:
>> Fix ASan test cases after r263177
>>
>> Modified:
>>     compiler-rt/trunk/test/asan/TestCases/printf-2.c
>>     compiler-rt/trunk/test/asan/TestCases/strcasestr-2.c
>>     compiler-rt/trunk/test/asan/TestCases/strstr-2.c
>>
>> Modified: compiler-rt/trunk/test/asan/TestCases/printf-2.c
>> URL:
>> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/printf-2.c?rev=263195&r1=263194&r2=263195&view=diff
>>
>> ==============================================================================
>> --- compiler-rt/trunk/test/asan/TestCases/printf-2.c (original)
>> +++ compiler-rt/trunk/test/asan/TestCases/printf-2.c Thu Mar 10 23:04:49
>> 2016
>> @@ -1,9 +1,9 @@
>>  // RUN: %clang_asan -O2 %s -o %t
>> -// We need replace_str=0 and replace_intrin=0 to avoid reporting errors
>> in
>> -// strlen() and memcpy() called by printf().
>> -// RUN: %env_asan_opts=replace_str=0:replace_intrin=0:check_printf=1 not
>> %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
>> -// RUN: %env_asan_opts=replace_str=0:replace_intrin=0:check_printf=0
>> %run %t 2>&1 | FileCheck --check-prefix=CHECK-OFF %s
>> -// RUN: %env_asan_opts=replace_str=0:replace_intrin=0 not %run %t 2>&1 |
>> FileCheck --check-prefix=CHECK-ON %s
>> +// We need replace_str=0, intercept_strlen=0 and replace_intrin=0 to
>> avoid
>> +// reporting errors in strlen() and memcpy() called by printf().
>> +// RUN:
>> %env_asan_opts=replace_str=0:intercept_strlen=0:replace_intrin=0:check_printf=1
>> not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
>> +// RUN:
>> %env_asan_opts=replace_str=0:intercept_strlen=0:replace_intrin=0:check_printf=0
>> %run %t 2>&1 | FileCheck --check-prefix=CHECK-OFF %s
>> +// RUN: %env_asan_opts=replace_str=0:intercept_strlen=0:replace_intrin=0
>> not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
>>
>>  // FIXME: printf is not intercepted on Windows yet.
>>  // XFAIL: win32
>>
>> Modified: compiler-rt/trunk/test/asan/TestCases/strcasestr-2.c
>> URL:
>> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/strcasestr-2.c?rev=263195&r1=263194&r2=263195&view=diff
>>
>> ==============================================================================
>> --- compiler-rt/trunk/test/asan/TestCases/strcasestr-2.c (original)
>> +++ compiler-rt/trunk/test/asan/TestCases/strcasestr-2.c Thu Mar 10
>> 23:04:49 2016
>> @@ -3,7 +3,7 @@
>>
>>  // Test intercept_strstr asan option
>>  // Disable other interceptors because strlen may be called inside
>> strcasestr
>> -// RUN: %env_asan_opts=intercept_strstr=false:replace_str=false %run %t
>> 2>&1
>> +// RUN:
>> %env_asan_opts=intercept_strstr=false:replace_str=false:intercept_strlen=false
>> %run %t 2>&1
>>
>>  // There's no interceptor for strcasestr on Windows
>>  // XFAIL: win32
>>
>> Modified: compiler-rt/trunk/test/asan/TestCases/strstr-2.c
>> URL:
>> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/strstr-2.c?rev=263195&r1=263194&r2=263195&view=diff
>>
>> ==============================================================================
>> --- compiler-rt/trunk/test/asan/TestCases/strstr-2.c (original)
>> +++ compiler-rt/trunk/test/asan/TestCases/strstr-2.c Thu Mar 10 23:04:49
>> 2016
>> @@ -3,7 +3,7 @@
>>
>>  // Test intercept_strstr asan option
>>  // Disable other interceptors because strlen may be called inside strstr
>> -// RUN: %env_asan_opts=intercept_strstr=false:replace_str=false %run %t
>> 2>&1
>> +// RUN:
>> %env_asan_opts=intercept_strstr=false:replace_str=false:intercept_strlen=false
>> %run %t 2>&1
>>
>>  #include <assert.h>
>>  #include <string.h>
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>
>
>


-- 
Alexey Samsonov
vonosmas at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160311/636178cd/attachment.html>


More information about the llvm-commits mailing list