diff --git a/builder.json b/builder.json index cdb127746f..569b6547c4 100644 --- a/builder.json +++ b/builder.json @@ -19,5 +19,9 @@ ["dir", "/s", "/b"] ] } + }, + + "build_env": { + "ASAN_OPTIONS": "suppressions={source_dir}/tests/resources/suppressions_asan.txt" } } diff --git a/source/posix/system_info.c b/source/posix/system_info.c index 03961c88b2..b5a0edc87e 100644 --- a/source/posix/system_info.c +++ b/source/posix/system_info.c @@ -56,10 +56,9 @@ uint16_t aws_get_cpu_group_count(void) { return 1U; } -AWS_SUPPRESS_ASAN static size_t s_numa_cpu_count_for_group(uint16_t group_idx) { - AWS_FATAL_ASSERT(g_numa_node_of_cpu_ptr); - - size_t total_cpus = aws_system_info_processor_count(); +size_t aws_get_cpu_count_for_group(uint16_t group_idx) { + if (g_numa_node_of_cpu_ptr) { + size_t total_cpus = aws_system_info_processor_count(); uint16_t cpu_count = 0; for (size_t i = 0; i < total_cpus; ++i) { @@ -67,12 +66,7 @@ AWS_SUPPRESS_ASAN static size_t s_numa_cpu_count_for_group(uint16_t group_idx) { cpu_count++; } } - return cpu_count; -} - -size_t aws_get_cpu_count_for_group(uint16_t group_idx) { - if (g_numa_node_of_cpu_ptr) { - return s_numa_cpu_count_for_group(group_idx); + return cpu_count; } return aws_system_info_processor_count(); diff --git a/tests/resources/suppressions_asan.txt b/tests/resources/suppressions_asan.txt new file mode 100644 index 0000000000..d3ecfe2d49 --- /dev/null +++ b/tests/resources/suppressions_asan.txt @@ -0,0 +1 @@ +interceptor_via_lib:libnuma.so \ No newline at end of file