Merge branch 'make_clang_great_again_v2' of github.com:vjpai/grpc into fuzzy-bits

pull/5846/head
Craig Tiller 9 years ago
commit 3c3763b8b6
  1. 8
      Makefile
  2. 12
      build.yaml
  3. 9
      src/core/iomgr/fd_posix.c
  4. 8
      tools/run_tests/tests.json

@ -188,8 +188,8 @@ CC_tsan = clang
CXX_tsan = clang++
LD_tsan = clang
LDXX_tsan = clang++
CPPFLAGS_tsan = -O0 -fsanitize=thread -fno-omit-frame-pointer -Wno-unused-command-line-argument -fPIE -pie -DGPR_NO_DIRECT_SYSCALLS
LDFLAGS_tsan = -fsanitize=thread -fPIE -pie
CPPFLAGS_tsan = -O0 -fsanitize=thread -fno-omit-frame-pointer -Wno-unused-command-line-argument -DGPR_NO_DIRECT_SYSCALLS
LDFLAGS_tsan = -fsanitize=thread
DEFINES_tsan += GRPC_TEST_SLOWDOWN_BUILD_FACTOR=5
VALID_CONFIG_stapprof = 1
@ -225,8 +225,8 @@ CC_etsan = clang
CXX_etsan = clang++
LD_etsan = clang
LDXX_etsan = clang++
CPPFLAGS_etsan = -O0 -fsanitize=thread -fno-omit-frame-pointer -Wno-unused-command-line-argument -fPIE -pie -DGPR_NO_DIRECT_SYSCALLS
LDFLAGS_etsan = -fsanitize=thread -fPIE -pie
CPPFLAGS_etsan = -O0 -fsanitize=thread -fno-omit-frame-pointer -Wno-unused-command-line-argument -DGPR_NO_DIRECT_SYSCALLS
LDFLAGS_etsan = -fsanitize=thread
DEFINES_etsan = _DEBUG DEBUG GRPC_EXECUTION_CONTEXT_SANITIZER
DEFINES_etsan += GRPC_TEST_SLOWDOWN_BUILD_FACTOR=5

@ -2519,8 +2519,6 @@ targets:
- gpr_test_util
- gpr
- grpc++_test_config
exclude_configs:
- tsan
platforms:
- mac
- linux
@ -2540,8 +2538,6 @@ targets:
- gpr_test_util
- gpr
- grpc++_test_config
exclude_configs:
- tsan
platforms:
- mac
- linux
@ -2874,11 +2870,11 @@ configs:
etsan:
CC: clang
CPPFLAGS: -O0 -fsanitize=thread -fno-omit-frame-pointer -Wno-unused-command-line-argument
-fPIE -pie -DGPR_NO_DIRECT_SYSCALLS
-DGPR_NO_DIRECT_SYSCALLS
CXX: clang++
DEFINES: _DEBUG DEBUG GRPC_EXECUTION_CONTEXT_SANITIZER
LD: clang
LDFLAGS: -fsanitize=thread -fPIE -pie
LDFLAGS: -fsanitize=thread
LDXX: clang++
compile_the_world: true
test_environ:
@ -2930,10 +2926,10 @@ configs:
tsan:
CC: clang
CPPFLAGS: -O0 -fsanitize=thread -fno-omit-frame-pointer -Wno-unused-command-line-argument
-fPIE -pie -DGPR_NO_DIRECT_SYSCALLS
-DGPR_NO_DIRECT_SYSCALLS
CXX: clang++
LD: clang
LDFLAGS: -fsanitize=thread -fPIE -pie
LDFLAGS: -fsanitize=thread
LDXX: clang++
compile_the_world: true
test_environ:

@ -72,6 +72,9 @@ static grpc_fd *fd_freelist = NULL;
static gpr_mu fd_freelist_mu;
static void freelist_fd(grpc_fd *fd) {
// Note that this function must be called after a release store (or
// full-barrier operation) on refst so that prior actions on the fd are
// ordered before the fd becomes visible to the freelist
gpr_mu_lock(&fd_freelist_mu);
fd->freelist_next = fd_freelist;
fd_freelist = fd;
@ -92,7 +95,6 @@ static grpc_fd *alloc_fd(int fd) {
gpr_mu_init(&r->mu);
}
gpr_atm_rel_store(&r->refst, 1);
r->shutdown = 0;
r->read_closure = CLOSURE_NOT_READY;
r->write_closure = CLOSURE_NOT_READY;
@ -104,6 +106,11 @@ static grpc_fd *alloc_fd(int fd) {
r->on_done_closure = NULL;
r->closed = 0;
r->released = 0;
// The last operation on r before returning it should be a release-store
// so that all the above fields are globally visible before the value of
// r could escape to another thread. Our refcount itself needs a release-store
// so use this
gpr_atm_rel_store(&r->refst, 1);
return r;
}

@ -2317,9 +2317,7 @@
"posix"
],
"cpu_cost": 0.5,
"exclude_configs": [
"tsan"
],
"exclude_configs": [],
"flaky": false,
"gtest": false,
"language": "c++",
@ -2338,9 +2336,7 @@
"posix"
],
"cpu_cost": 10,
"exclude_configs": [
"tsan"
],
"exclude_configs": [],
"flaky": false,
"gtest": false,
"language": "c++",

Loading…
Cancel
Save