summaryrefslogtreecommitdiffstats
path: root/database
diff options
context:
space:
mode:
authorvkalintiris <vasilis@netdata.cloud>2024-01-10 17:07:58 +0200
committerGitHub <noreply@github.com>2024-01-10 17:07:58 +0200
commite2c7888d6f228acd6813a7c57fadd355a073b780 (patch)
treedde11a0a295ce65917285f18c9d816a5b58e73eb /database
parent2dff2e5f3e979cdc774aa4e08743c8f3cc5515b2 (diff)
Address sanitizer through CMake and use it for unit tests. (#16748)
* Disable address sanitizer for some functions. These functions report some issues when running the address sanitizer with `-W unittest`. We want to run the sanitized binary on Github PRs to catch newly-introduced issues. FIXMEs were added so that we know which ones already existed prior to this change. * Add cmake option to use address sanitizer * Run unit tests with address sanitizer. * Specify attribute before the function declaration. * Disable hardening flags.
Diffstat (limited to 'database')
-rw-r--r--database/rrdlabels.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/database/rrdlabels.c b/database/rrdlabels.c
index 27f2878cdc..9a75763bff 100644
--- a/database/rrdlabels.c
+++ b/database/rrdlabels.c
@@ -694,6 +694,11 @@ static RRDLABEL *rrdlabels_find_label_with_key_unsafe(RRDLABELS *labels, RRDLABE
// ----------------------------------------------------------------------------
// rrdlabels_add()
+/*
+ * FIXME: Attribute added because address sanitizer reports an issue when
+ * running the agent with `-W unittest`.
+*/
+__attribute__((no_sanitize("address")))
static void labels_add_already_sanitized(RRDLABELS *labels, const char *key, const char *value, RRDLABEL_SRC ls)
{
RRDLABEL *new_label = add_label_name_value(key, value);