From 04589445aa666d75508abb42e27e3d6793634a67 Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Wed, 25 Sep 2024 22:38:50 +0200 Subject: [PATCH] [FIX] Sanitizer --- .github/workflows/ci_sanitizer.yml | 3 ++- src/ibf.cpp | 14 ++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci_sanitizer.yml b/.github/workflows/ci_sanitizer.yml index 58f44f7..b391bf9 100644 --- a/.github/workflows/ci_sanitizer.yml +++ b/.github/workflows/ci_sanitizer.yml @@ -15,7 +15,6 @@ concurrency: env: TZ: Europe/Berlin - ASAN_OPTIONS: strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1:detect_leaks=1 TSAN_OPTIONS: ignore_noninstrumented_modules=1 UBSAN_OPTIONS: print_stacktrace=1 @@ -28,6 +27,8 @@ jobs: name: ${{ matrix.name }} ${{ matrix.build_type }} ${{ matrix.os }} runs-on: ${{ matrix.os }} if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch' + env: + ASAN_OPTIONS: strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1:detect_leaks=${{ contains(matrix.os, 'macos') && '0' || '1' }} strategy: fail-fast: false matrix: diff --git a/src/ibf.cpp b/src/ibf.cpp index 67706ab..e259668 100644 --- a/src/ibf.cpp +++ b/src/ibf.cpp @@ -865,8 +865,11 @@ void ibf_helper(std::vector const & minimiser_files, { if (elem.second >= expressions[i][j]) { - ibfs[j].emplace(elem.first, seqan3::bin_index{i}); - counts_per_level[i][j]++; + #pragma omp critical + { + ibfs[j].emplace(elem.first, seqan3::bin_index{i}); + counts_per_level[i][j]++; + } break; } } @@ -874,8 +877,11 @@ void ibf_helper(std::vector const & minimiser_files, { if (elem.second >= ibf_args.expression_thresholds[j]) { - ibfs[j].emplace(elem.first, seqan3::bin_index{i}); - counts_per_level[i][j]++; + #pragma omp critical + { + ibfs[j].emplace(elem.first, seqan3::bin_index{i}); + counts_per_level[i][j]++; + } break; } }