Skip to content

Commit

Permalink
Workaround ASAN false positive in test_eh_algorithm (#767)
Browse files Browse the repository at this point in the history
Signed-off-by: Alexei Katranov <alexei.katranov@intel.com>
  • Loading branch information
alexey-katranov authored Feb 4, 2022
1 parent 6a15b64 commit f5ed9a6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/tbb/test_eh_algorithms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1535,6 +1535,11 @@ void Test4_pipeline ( const FilterSet& filters ) {
//! Tests pipeline function passed with different combination of filters
template<void testFunc(const FilterSet&)>
void TestWithDifferentFiltersAndConcurrency() {
#if __TBB_USE_ADDRESS_SANITIZER
// parallel_pipeline allocates tls that sporadically observed as a memory leak with
// detached threads. So, use task_scheduler_handle to join threads with finalize
tbb::task_scheduler_handle handle{ tbb::attach{} };
#endif
for (auto concurrency_level: utils::concurrency_range()) {
g_NumThreads = static_cast<int>(concurrency_level);
g_Master = std::this_thread::get_id();
Expand Down Expand Up @@ -1564,6 +1569,9 @@ void TestWithDifferentFiltersAndConcurrency() {
}
}
}
#if __TBB_USE_ADDRESS_SANITIZER
tbb::finalize(handle);
#endif
}

//! Testing parallel_pipeline exception handling
Expand Down

0 comments on commit f5ed9a6

Please sign in to comment.