forked from vesoft-inc/nebula
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added default sanitizer options (vesoft-inc#108)
* Added default sanitizer options * add comments * Fixed FindPCH * GCC 7.3 doesnt support no_sanitize attributes
- Loading branch information
Showing
19 changed files
with
124 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* Copyright (c) 2018 - present, VE Software Inc. All rights reserved | ||
* | ||
* This source code is licensed under Apache 2.0 License | ||
* (found in the LICENSE.Apache file in the root directory) | ||
*/ | ||
#include "base/Base.h" | ||
|
||
#ifdef BUILT_WITH_SANITIZER | ||
|
||
// Following hook functions are required by the sanitizer runtime library. | ||
// So make them exported. | ||
// Besides, keep these hooks outside the consideration of sanitizer | ||
#define SANITIZER_HOOK_ATTRIBUTES \ | ||
__attribute__((visibility("default"))) \ | ||
// __attribute__((no_sanitize("address", "thread", "undefined"))) | ||
|
||
extern "C" { | ||
|
||
SANITIZER_HOOK_ATTRIBUTES | ||
const char* __asan_default_options() { | ||
// You could add new or update existing options via ASAN_OPTIONS at runtime. | ||
return "" | ||
"fast_unwind_on_malloc=0 \n" | ||
"detect_stack_use_after_return=1 \n" | ||
"alloc_dealloc_mismatch=1 \n" | ||
"new_delete_type_mismatch=1 \n" | ||
"strict_init_order=1 \n" | ||
"intercept_tls_get_addr=1 \n" | ||
"symbolize_inline_frames=1 \n" | ||
"strict_string_checks=1 \n" | ||
"detect_container_overflow=1 \n" | ||
"strip_path_prefix=" NEBULA_STRINGIFY(NEBULA_HOME) "/ \n" | ||
""; | ||
} | ||
|
||
|
||
SANITIZER_HOOK_ATTRIBUTES | ||
const char* __asan_default_suppressions() { | ||
return "" | ||
"" | ||
""; | ||
} | ||
|
||
|
||
SANITIZER_HOOK_ATTRIBUTES | ||
const char* __lsan_default_options() { | ||
return "" | ||
"" | ||
""; | ||
} | ||
|
||
|
||
SANITIZER_HOOK_ATTRIBUTES | ||
const char* __lsan_default_suppressions() { | ||
// NOTE Don't add extra spaces around the suppression patterns, unless you intend to. | ||
return "" | ||
"leak:folly::SingletonVault::destroyInstances\n" | ||
""; | ||
} | ||
|
||
} // extern "C" | ||
|
||
#undef SANITIZER_HOOK_ATTRIBUTES | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,4 +20,4 @@ target_link_libraries( | |
pthread | ||
dl | ||
) | ||
add_test(NAME thread_test COMMAND thread_test) | ||
nebula_add_test(thread_test) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.