[compiler-rt] r252742 - [ASan] Improve portability of new tests.

Evgenii Stepanov via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 11 12:12:13 PST 2015


Also, this test hangs on linux starting with:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/21209

(gdb) bt
#0 0x00002ab6bb05bee5 in pthread_join () from
/lib/x86_64-linux-gnu/libpthread.so.0
#1 0x00000000004f7a6e in main ()
(gdb) info threads
 Id Target Id Frame
 3 Thread 0x2ab6be600700 (LWP 30581) "halt_on_error-s"
 0x0000000000428f7a in __sanitizer::StaticSpinMutex::LockSlow() () at
/mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/projects/compiler-rt/lib/asan/../sanitizer_common/sanitizer_atomic_clang_x86.h:23
 2 Thread 0x2ab6be801700 (LWP 30588) "halt_on_error-s"
 __sanitizer::BlockingMutex::Lock() () at
/mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_atomic_clang.h:68
* 1 Thread 0x2ab6bae5e9e0 (LWP 30579) "halt_on_error-s"
 0x00002ab6bb05bee5 in pthread_join () from
/lib/x86_64-linux-gnu/libpthread.so.0

On Wed, Nov 11, 2015 at 12:01 PM, Evgenii Stepanov
<eugeni.stepanov at gmail.com> wrote:
> On Android rand_r appears in API 21, and we need to support at least API 19.
> You may need to use locked rand() or even implement a simple generator
> right in the test.
>
>
> On Wed, Nov 11, 2015 at 7:42 AM, Yury Gribov via llvm-commits
> <llvm-commits at lists.llvm.org> wrote:
>> Author: ygribov
>> Date: Wed Nov 11 09:42:26 2015
>> New Revision: 252742
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=252742&view=rev
>> Log:
>> [ASan] Improve portability of new tests.
>>
>> Modified:
>>     compiler-rt/trunk/test/asan/TestCases/Linux/halt_on_error-signals.c
>>     compiler-rt/trunk/test/asan/TestCases/Linux/halt_on_error-torture.cc
>>
>> Modified: compiler-rt/trunk/test/asan/TestCases/Linux/halt_on_error-signals.c
>> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Linux/halt_on_error-signals.c?rev=252742&r1=252741&r2=252742&view=diff
>> ==============================================================================
>> --- compiler-rt/trunk/test/asan/TestCases/Linux/halt_on_error-signals.c (original)
>> +++ compiler-rt/trunk/test/asan/TestCases/Linux/halt_on_error-signals.c Wed Nov 11 09:42:26 2015
>> @@ -1,6 +1,6 @@
>>  // Test interaction of Asan recovery mode with asynch signals.
>>  //
>> -// RUN: %clang_asan -fsanitize-recover=address %s -o %t
>> +// RUN: %clang_asan -fsanitize-recover=address -pthread %s -o %t
>>  //
>>  // RUN: rm -f %t.log
>>  // RUN: env ASAN_OPTIONS=halt_on_error=false %run %t 1000 >%t.log 2>&1 || true
>> @@ -10,6 +10,9 @@
>>  //
>>  // REQUIRES: stable-runtime
>>
>> +#define _POSIX_C_SOURCE 200112  // rand_r
>> +#define _SVID_SOURCE 1  // SA_NODEFER
>> +
>>  #include <stdio.h>
>>  #include <stdlib.h>
>>  #include <string.h>
>>
>> Modified: compiler-rt/trunk/test/asan/TestCases/Linux/halt_on_error-torture.cc
>> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Linux/halt_on_error-torture.cc?rev=252742&r1=252741&r2=252742&view=diff
>> ==============================================================================
>> --- compiler-rt/trunk/test/asan/TestCases/Linux/halt_on_error-torture.cc (original)
>> +++ compiler-rt/trunk/test/asan/TestCases/Linux/halt_on_error-torture.cc Wed Nov 11 09:42:26 2015
>> @@ -1,6 +1,6 @@
>>  // Stress test recovery mode with many threads.
>>  //
>> -// RUN: %clangxx_asan -fsanitize-recover=address %s -o %t
>> +// RUN: %clangxx_asan -fsanitize-recover=address -pthread %s -o %t
>>  //
>>  // RUN: env ASAN_OPTIONS=halt_on_error=false:max_errors=1000 %run %t 1 10 >1.txt 2>&1
>>  // RUN: FileCheck %s < 1.txt
>> @@ -15,6 +15,8 @@
>>  //
>>  // REQUIRES: stable-runtime
>>
>> +#define _POSIX_C_SOURCE 200112  // rand_r
>> +
>>  #include <stdio.h>
>>  #include <stdlib.h>
>>  #include <pthread.h>
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits


More information about the llvm-commits mailing list