Skip to content

Commit c3f8297

Browse files
committed
chore: clean up sanitizers checks
1 parent 627805f commit c3f8297

File tree

7 files changed

+0
-50
lines changed

7 files changed

+0
-50
lines changed

CMakeLists.txt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ option(DF_USE_SSL "Provide support for SSL connections" ON)
6161

6262
find_package(OpenSSL)
6363

64-
SET(SANITIZERS OFF)
65-
6664
# AFL++ configuration - must be before sanitizer checks
6765
if(USE_AFL)
6866
message(STATUS "AFL++ fuzzing mode active")
@@ -91,18 +89,12 @@ option(WITH_ASAN "Enable -fsanitize=address" OFF)
9189
if (SUPPORT_ASAN AND WITH_ASAN)
9290
message(STATUS "address sanitizer enabled")
9391
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fsanitize=address")
94-
set(SANITIZERS ON)
9592
endif()
9693

9794
option(WITH_USAN "Enable -fsanitize=undefined" OFF)
9895
if (SUPPORT_USAN AND WITH_USAN)
9996
message(STATUS "ub sanitizer enabled")
10097
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fsanitize=undefined")
101-
set(SANITIZERS ON)
102-
endif()
103-
104-
if(SANITIZERS)
105-
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
10698
endif()
10799

108100
include(third_party)

src/server/CMakeLists.txt

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,6 @@ if (PRINT_STACKTRACES_ON_SIGNAL)
103103
target_compile_definitions(dragonfly_lib PRIVATE PRINT_STACKTRACES_ON_SIGNAL)
104104
endif()
105105

106-
if (WITH_ASAN OR WITH_USAN)
107-
target_compile_definitions(dfly_transaction PRIVATE SANITIZERS)
108-
endif()
109-
110106
if (WITH_AWS)
111107
SET(AWS_LIB awsv2_lib)
112108
add_definitions(-DWITH_AWS)
@@ -132,10 +128,6 @@ endif()
132128
add_library(dfly_test_lib test_utils.cc)
133129
cxx_link(dfly_test_lib dragonfly_lib facade_test gtest_main_ext)
134130

135-
if (WITH_ASAN OR WITH_USAN)
136-
target_compile_definitions(dfly_test_lib PRIVATE SANITIZERS)
137-
endif()
138-
139131
cxx_test(dragonfly_test dfly_test_lib LABELS DFLY)
140132
cxx_test(multi_test dfly_test_lib LABELS DFLY)
141133
cxx_test(generic_family_test dfly_test_lib LABELS DFLY)
@@ -162,14 +154,6 @@ cxx_test(cluster/cluster_config_test dfly_test_lib LABELS DFLY)
162154
cxx_test(cluster/cluster_family_test dfly_test_lib LABELS DFLY)
163155
cxx_test(acl/acl_family_test dfly_test_lib LABELS DFLY)
164156
cxx_test(engine_shard_set_test dfly_test_lib LABELS DFLY)
165-
if (WITH_ASAN OR WITH_USAN)
166-
target_compile_definitions(stream_family_test PRIVATE SANITIZERS)
167-
target_compile_definitions(multi_test PRIVATE SANITIZERS)
168-
target_compile_definitions(search_family_test PRIVATE SANITIZERS)
169-
target_compile_definitions(json_family_test PRIVATE SANITIZERS)
170-
target_compile_definitions(json_family_memory_test PRIVATE SANITIZERS)
171-
target_compile_definitions(dragonfly_test PRIVATE SANITIZERS)
172-
endif()
173157

174158
add_dependencies(check_dfly dragonfly_test json_family_test list_family_test
175159
generic_family_test memcache_parser_test rdb_test journal_test

src/server/dragonfly_test.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,6 @@ TEST_F(DflyEngineTest, OOM) {
491491
}
492492
}
493493

494-
#ifndef SANITIZERS
495494
/// Reproduces the case where items with expiry data were evicted,
496495
/// and then written with the same key.
497496
TEST_F(DflyEngineTest, Bug207) {
@@ -561,8 +560,6 @@ TEST_F(DflyEngineTest, StickyEviction) {
561560
}
562561
}
563562

564-
#endif
565-
566563
TEST_F(DflyEngineTest, ZeroAllocationEviction) {
567564
max_memory_limit = 500000; // 0.5mb
568565
shard_set->TEST_EnableCacheMode();

src/server/json_family_test.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2567,10 +2567,8 @@ TEST_F(JsonFamilyTest, MGet) {
25672567
resp = Run({"JSON.SET", "json2", ".", json[1]});
25682568
ASSERT_THAT(resp, "OK");
25692569

2570-
#ifndef SANITIZERS
25712570
resp = Run({"JSON.MGET", "json1", "??INNNNVALID??"});
25722571
EXPECT_THAT(resp, ErrArg("ERR syntax error"));
2573-
#endif
25742572

25752573
resp = Run({"JSON.MGET", "json1", "json2", "json3", "$.address.country"});
25762574
ASSERT_EQ(RespExpr::ARRAY, resp.type);

src/server/multi_test.cc

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,6 @@ TEST_F(MultiTest, FlushDb) {
463463
// Triggers a false possitive and therefore we turn it off
464464
// There seem not to be a good solution to handle these false positives
465465
// since sanitizers work well with u_context which is *very* slow
466-
#ifndef SANITIZERS
467466
TEST_F(MultiTest, Eval) {
468467
if (auto config = absl::GetFlag(FLAGS_default_lua_flags); config != "") {
469468
GTEST_SKIP() << "Skipped Eval test because default_lua_flags is set";
@@ -555,7 +554,6 @@ TEST_F(MultiTest, Eval) {
555554
EXPECT_EQ(resp.GetVec()[0], "0");
556555
EXPECT_EQ(resp.GetVec()[1].type, RespExpr::Type::ARRAY);
557556
}
558-
#endif
559557

560558
TEST_F(MultiTest, Watch) {
561559
auto kExecFail = ArgType(RespExpr::NIL);
@@ -784,7 +782,6 @@ TEST_F(MultiTest, ExecGlobalFallback) {
784782
EXPECT_EQ(1, GetMetrics().coordinator_stats.tx_global_cnt);
785783
}
786784

787-
#ifndef SANITIZERS
788785
TEST_F(MultiTest, ScriptFlagsCommand) {
789786
if (auto flags = absl::GetFlag(FLAGS_default_lua_flags); flags != "") {
790787
GTEST_SKIP() << "Skipped ScriptFlagsCommand test because default_lua_flags is set";
@@ -820,7 +817,6 @@ TEST_F(MultiTest, ScriptFlagsCommand) {
820817
EXPECT_THAT(Run({"eval", kUndeclared2, "0"}), "works");
821818
}
822819
}
823-
#endif
824820

825821
TEST_F(MultiTest, ScriptFlagsEmbedded) {
826822
const char* s1 = R"(
@@ -1200,8 +1196,6 @@ TEST_F(MultiEvalTest, MultiSomeEval) {
12001196
EXPECT_THAT(brpop_resp, ArgType(RespExpr::NIL_ARRAY));
12011197
}
12021198

1203-
// Flaky because of https://github.com/google/sanitizers/issues/1760
1204-
#ifndef SANITIZERS
12051199
TEST_F(MultiEvalTest, ScriptSquashingUknownCmd) {
12061200
absl::FlagSaver fs;
12071201
absl::SetFlag(&FLAGS_lua_auto_async, true);
@@ -1220,7 +1214,6 @@ TEST_F(MultiEvalTest, ScriptSquashingUknownCmd) {
12201214
EXPECT_THAT(Run({"EVAL", s, "1", "A"}), ErrArg("unknown command `SECOND WRONG`"));
12211215
EXPECT_EQ(Run({"get", "A"}), "2");
12221216
}
1223-
#endif
12241217

12251218
TEST_F(MultiEvalTest, MultiAndEval) {
12261219
// We had a bug in borrowing interpreters which caused a crash in this scenario

src/server/search/search_family_test.cc

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,6 @@ TEST_F(SearchFamilyTest, Stats) {
323323
EXPECT_LE(metrics.search_stats.used_memory, 3 * expected_usage);
324324
}
325325

326-
// todo: ASAN fails heres on arm
327-
#ifndef SANITIZERS
328326
TEST_F(SearchFamilyTest, Simple) {
329327
Run({"hset", "d:1", "foo", "baz", "k", "v"});
330328
Run({"hset", "d:2", "foo", "bar", "k", "v"});
@@ -346,7 +344,6 @@ TEST_F(SearchFamilyTest, Simple) {
346344
Run({"hset", "w:2", "foo", "this", "k", "v"});
347345
EXPECT_THAT(Run({"ft.search", "i1", "@foo:this"}), kNoResults);
348346
}
349-
#endif
350347

351348
TEST_F(SearchFamilyTest, Errors) {
352349
Run({"ft.create", "i1", "PREFIX", "1", "d:", "SCHEMA", "foo", "TAG", "bar", "TEXT"});
@@ -419,8 +416,6 @@ TEST_F(SearchFamilyTest, JsonIdentifierWithBrackets) {
419416
EXPECT_THAT(Run({"ft.search", "i1", "(@continent:{Europe})"}), AreDocIds("k1", "k2"));
420417
}
421418

422-
// todo: fails on arm build
423-
#ifndef SANITIZERS
424419
TEST_F(SearchFamilyTest, JsonArrayValues) {
425420
string_view D1 = R"(
426421
{
@@ -495,7 +490,6 @@ TEST_F(SearchFamilyTest, JsonArrayValues) {
495490
res = Run({"ft.search", "i1", "@name:alex", "return", "1", "::??INVALID??::", "as", "retval"});
496491
EXPECT_THAT(res, IsMapWithSize("k1", IsMap()));
497492
}
498-
#endif
499493

500494
TEST_F(SearchFamilyTest, Tags) {
501495
Run({"hset", "d:1", "color", "red, green"});
@@ -963,7 +957,6 @@ TEST_F(SearchFamilyTest, FtProfile) {
963957
ASSERT_ARRAY_OF_TWO_ARRAYS(resp);
964958
}
965959

966-
#ifndef SANITIZERS
967960
TEST_F(SearchFamilyTest, FtProfileInvalidQuery) {
968961
Run({"json.set", "j1", ".", R"({"id":"1"})"});
969962
Run({"ft.create", "i1", "on", "json", "schema", "$.id", "as", "id", "tag"});
@@ -976,7 +969,6 @@ TEST_F(SearchFamilyTest, FtProfileInvalidQuery) {
976969
resp = Run({"ft.profile", "i1", "search", "query", "@{invalid13289}"});
977970
EXPECT_THAT(resp, ErrArg("query syntax error"));
978971
}
979-
#endif
980972

981973
TEST_F(SearchFamilyTest, FtProfileErrorReply) {
982974
Run({"ft.create", "i1", "schema", "name", "text"});
@@ -1286,8 +1278,6 @@ TEST_F(SearchFamilyTest, FlushSearchIndices) {
12861278
EXPECT_THAT(resp, ErrArg("ERR Index already exists"));
12871279
}
12881280

1289-
// todo: ASAN fails heres on arm
1290-
#ifndef SANITIZERS
12911281
TEST_F(SearchFamilyTest, AggregateWithLoadOptionHard) {
12921282
// Test HASH
12931283
Run({"HSET", "h1", "word", "item1", "foo", "10", "text", "first key"});
@@ -1327,7 +1317,6 @@ TEST_F(SearchFamilyTest, AggregateWithLoadOptionHard) {
13271317
EXPECT_THAT(resp, IsUnordArrayWithSize(IsMap("foo_total", "20", "word", "item2"),
13281318
IsMap("foo_total", "10", "word", "item1")));
13291319
}
1330-
#endif
13311320

13321321
TEST_F(SearchFamilyTest, WrongFieldTypeJson) {
13331322
// Test simple

src/server/stream_family_test.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -504,16 +504,13 @@ TEST_F(StreamFamilyTest, XReadGroupEmpty) {
504504
EXPECT_THAT(resp, ArrLen(2));
505505
}
506506

507-
// todo: ASAN fails heres on arm
508-
#ifndef SANITIZERS
509507
TEST_F(StreamFamilyTest, Issue854) {
510508
auto resp = Run({"xgroup", "help"});
511509
EXPECT_THAT(resp, ArgType(RespExpr::ARRAY));
512510

513511
resp = Run({"eval", "redis.call('xgroup', 'help')", "0"});
514512
EXPECT_THAT(resp, ErrArg("is not allowed"));
515513
}
516-
#endif
517514

518515
TEST_F(StreamFamilyTest, XGroupConsumer) {
519516
Run({"xgroup", "create", "foo", "group", "$", "MKSTREAM"});

0 commit comments

Comments
 (0)