kejiewei / thread-sanitizer

Automatically exported from code.google.com/p/thread-sanitizer
0 stars 0 forks source link

memset/memcpy/memmove are not instrumented by tsan #16

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
% cat memcpy16.cc 
#include <string.h>
void foo(int *x, int *y) {
  memcpy(x, y, 16);
}

% clang -fsanitize=thread -O -S -o -  memcpy16.cc
        callq   __tsan_func_entry
        movups  (%r14), %xmm0
        movups  %xmm0, (%rbx)
        callq   __tsan_func_exit

The simplest way is to replace mem intrins with __tsan_memset/etc, 
like we do in msan.

Ideally, the instrumentation module should know when the intrinsic 
will be inlined. But that's not trivial. 

Original issue reported on code.google.com by konstant...@gmail.com on 25 Mar 2013 at 1:20

GoogleCodeExporter commented 9 years ago
Should be fixed by  http://llvm.org/viewvc/llvm-project?rev=178230&view=rev

Original comment by konstant...@gmail.com on 28 Mar 2013 at 11:26

GoogleCodeExporter commented 9 years ago
Adding Project:ThreadSanitizer as part of GitHub migration.

Original comment by gli...@google.com on 30 Jul 2015 at 9:21