File tree 8 files changed +19
-32
lines changed
.azure-pipelines-templates
8 files changed +19
-32
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ parameters:
33
33
cmake_args : " -DCMAKE_BUILD_TYPE=Debug"
34
34
cmake_env : " "
35
35
ASAN :
36
- cmake_args : " -DSAN=ON"
36
+ cmake_args : " -DSAN=ON -DUSE_LIBCXX=OFF "
37
37
cmake_env : " "
38
38
TSAN :
39
39
cmake_args : " -DTSAN=ON -DWORKER_THREADS=2"
Original file line number Diff line number Diff line change 53
53
git config --global --add safe.directory "$GITHUB_WORKSPACE"
54
54
mkdir build
55
55
cd build
56
- cmake -GNinja -DCOMPILE_TARGET=virtual -DCMAKE_BUILD_TYPE=Debug -DLONG_TESTS=ON -DSAN=ON ..
56
+ cmake -GNinja -DCOMPILE_TARGET=virtual -DCMAKE_BUILD_TYPE=Debug -DLONG_TESTS=ON -DSAN=ON -DUSE_LIBCXX=OFF ..
57
57
ninja
58
58
59
59
- name : " Test"
Original file line number Diff line number Diff line change @@ -929,13 +929,6 @@ if(BUILD_TESTS)
929
929
PROPERTY LABELS unit_test
930
930
)
931
931
932
- # https://github.com/microsoft/CCF/issues/5198
933
- set_property (
934
- TEST csr_test
935
- APPEND
936
- PROPERTY ENVIRONMENT "ASAN_OPTIONS=alloc_dealloc_mismatch=0"
937
- )
938
-
939
932
add_test (NAME versionifier_test
940
933
COMMAND ${PYTHON}
941
934
${CMAKE_SOURCE_DIR} /python/src/ccf/_versionifier.py
Original file line number Diff line number Diff line change @@ -26,13 +26,6 @@ function(add_unit_test name)
26
26
"TSAN_OPTIONS=suppressions=${CCF_DIR} /tsan_env_suppressions"
27
27
)
28
28
29
- # https://github.com/microsoft/CCF/issues/5198
30
- set_property (
31
- TEST ${name}
32
- APPEND
33
- PROPERTY ENVIRONMENT "ASAN_OPTIONS=alloc_dealloc_mismatch=0"
34
- )
35
-
36
29
endfunction ()
37
30
38
31
# Test binary wrapper
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ namespace ccf::http
46
46
bool operator <(const AcceptHeaderField& other) const
47
47
{
48
48
static constexpr auto float_comp_epsilon = 0 .0000001f ;
49
- if (abs (q_factor - other.q_factor ) > float_comp_epsilon)
49
+ if (std:: abs (q_factor - other.q_factor ) > float_comp_epsilon)
50
50
{
51
51
return q_factor < other.q_factor ;
52
52
}
Original file line number Diff line number Diff line change @@ -145,19 +145,24 @@ namespace ringbuffer
145
145
{
146
146
static inline uint64_t read64_impl (const BufferDef& bd, size_t index)
147
147
{
148
+ auto src = bd.data + index ;
149
+ auto src_64 = reinterpret_cast <uint64_t *>(src);
150
+
148
151
#ifdef __cpp_lib_atomic_ref
149
- auto & ref = *(reinterpret_cast <uint64_t *>(bd.data + index ));
150
- std::atomic_ref<uint64_t > slot (ref);
151
- return slot.load (std::memory_order_acquire);
152
- #else
153
- // __atomic_load is used instead of std::atomic_ref since it's not
154
- // supported by libc++ yet.
152
+ if (Const::is_aligned (src, 8 ))
153
+ {
154
+ auto & ref = *src_64;
155
+ std::atomic_ref<uint64_t > slot (ref);
156
+ return slot.load (std::memory_order_acquire);
157
+ }
158
+ #endif
159
+
160
+ // __atomic_load is used instead of std::atomic_ref when std::atomic_ref
161
+ // is unavailable, or the src pointer is not aligned
155
162
// https://en.cppreference.com/w/Template:cpp/compiler_support/20
156
163
uint64_t r = 0 ;
157
- __atomic_load (
158
- reinterpret_cast <uint64_t *>(bd.data + index ), &r, __ATOMIC_ACQUIRE);
164
+ __atomic_load (src_64, &r, __ATOMIC_ACQUIRE);
159
165
return r;
160
- #endif
161
166
}
162
167
163
168
static inline Message message (uint64_t header)
Original file line number Diff line number Diff line change @@ -495,7 +495,6 @@ def run_config_timeout_check(args):
495
495
env = {}
496
496
if args .enclave_platform == "snp" :
497
497
env = snp .get_aci_env ()
498
- env ["ASAN_OPTIONS" ] = "alloc_dealloc_mismatch=0"
499
498
500
499
proc = subprocess .Popen (
501
500
[
@@ -566,7 +565,7 @@ def run_configuration_file_checks(args):
566
565
for config in config_files_to_check :
567
566
cmd = [bin_path , f"--config={ config } " , "--check" ]
568
567
rc = infra .proc .ccall (
569
- * cmd , env = { "ASAN_OPTIONS" : "alloc_dealloc_mismatch=0" }
568
+ * cmd ,
570
569
).returncode
571
570
assert rc == 0 , f"Failed to check configuration: { rc } "
572
571
LOG .success (f"Successfully check sample configuration file { config } " )
Original file line number Diff line number Diff line change @@ -362,10 +362,7 @@ def __init__(
362
362
if ubsan_opts :
363
363
env ["UBSAN_OPTIONS" ] += ":" + ubsan_opts
364
364
env ["TSAN_OPTIONS" ] = os .environ .get ("TSAN_OPTIONS" , "" )
365
- # https://github.com/microsoft/CCF/issues/5198
366
- env ["ASAN_OPTIONS" ] = os .environ .get (
367
- "ASAN_OPTIONS" , "alloc_dealloc_mismatch=0"
368
- )
365
+ env ["ASAN_OPTIONS" ] = os .environ .get ("ASAN_OPTIONS" , "" )
369
366
elif enclave_platform == "snp" :
370
367
env = snp .get_aci_env ()
371
368
snp_security_context_directory_envvar = (
You can’t perform that action at this time.
0 commit comments