The new storage (MetaMap) is based on direct shadow (instead of a hashmap + per-block lists). This solves a number of problems: - eliminates quadratic behaviour in SyncTab::GetAndLock (https://code.google.com/p/thread-sanitizer/issues/detail?id=26) - eliminates contention in SyncTab - eliminates contention in internal allocator during allocation of sync objects - removes a bunch of ad-hoc code in java interface - reduces java shadow from 2x to 1/2x - allows to memorize heap block meta info for Java and Go - allows to cleanup sync object meta info for Go - which in turn enabled deadlock detector for Go llvm-svn: 209810
32 lines
787 B
Bash
Executable File
32 lines
787 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Ensure that tsan runtime does not contain compiler-emitted memcpy and memset calls.
|
|
|
|
set -eu
|
|
|
|
ROOTDIR=$(dirname $0)
|
|
TEST_DIR=$ROOTDIR/../../test/tsan
|
|
|
|
: ${CXX:=clang++}
|
|
CFLAGS="-fsanitize=thread -fPIE -O1 -g"
|
|
LDFLAGS="-pie -lpthread -ldl -lrt -lm -Wl,--whole-archive $ROOTDIR/rtl/libtsan.a -Wl,--no-whole-archive"
|
|
|
|
SRC=$TEST_DIR/simple_race.cc
|
|
OBJ=$SRC.o
|
|
EXE=$SRC.exe
|
|
$CXX $SRC $CFLAGS -c -o $OBJ
|
|
$CXX $OBJ $LDFLAGS -o $EXE
|
|
|
|
NCALL=$(objdump -d $EXE | egrep "callq .*<__interceptor_mem(cpy|set)>" | wc -l)
|
|
if [ "$NCALL" != "0" ]; then
|
|
echo FAIL: found $NCALL memcpy/memset calls
|
|
exit 1
|
|
fi
|
|
|
|
# tail calls
|
|
NCALL=$(objdump -d $EXE | egrep "jmpq .*<__interceptor_mem(cpy|set)>" | wc -l)
|
|
if [ "$NCALL" != "0" ]; then
|
|
echo FAIL: found $NCALL memcpy/memset calls
|
|
exit 1
|
|
fi
|