diff --git a/tbb-2021-avoid-zero-threads.patch b/tbb-2021-avoid-zero-threads.patch new file mode 100644 index 0000000..f70d14f --- /dev/null +++ b/tbb-2021-avoid-zero-threads.patch @@ -0,0 +1,29 @@ +From 8c968ef74bb804200cd25fa6e078d5aabed7a5e6 Mon Sep 17 00:00:00 2001 +From: Petter Reinholdtsen +Date: Tue, 31 Mar 2026 10:07:49 +0200 +Subject: [PATCH] Adjusted test_lightweight to avoid zero threads in test. + +When the hardware only support one core, hardware_concurrency() return 1, +which when deviced by 2 using integer division end up as 0, a useless +number of threads. Instead, ensure it end up as 1, while the other +return values still end up with a sensible number by changing +(i/2) to ((i+1)/2). + +This fix is related to #2027. +--- + test/common/graph_utils.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/test/common/graph_utils.h b/test/common/graph_utils.h +index 26a0c0ada0..714a27f79b 100644 +--- a/test/common/graph_utils.h ++++ b/test/common/graph_utils.h +@@ -953,7 +953,7 @@ template + void test_lightweight(unsigned N) { + test_unlimited_lightweight_execution(N); + test_limited_lightweight_execution(N, tbb::flow::serial); +- test_limited_lightweight_execution(N, (std::min)(std::thread::hardware_concurrency() / 2, N/2)); ++ test_limited_lightweight_execution(N, (std::min)((std::thread::hardware_concurrency()+1) / 2, N/2)); + + test_limited_lightweight_execution_with_throwing_body(N, tbb::flow::serial); + } diff --git a/tbb.spec b/tbb.spec index 3b56b74..b5d9d4f 100644 --- a/tbb.spec +++ b/tbb.spec @@ -5,7 +5,7 @@ Name: tbb Summary: The Threading Building Blocks library abstracts low-level threading details Version: 2021.11.0 -Release: 7%{?dist} +Release: 8%{?dist} License: Apache-2.0 AND BSD-3-Clause URL: http://threadingbuildingblocks.org/ @@ -21,6 +21,10 @@ Patch0: tbb-2021-Werror.patch # Fix code that violates the strict aliasing rules. Patch1: tbb-2021-strict-aliasing.patch +# https://github.com/uxlfoundation/oneTBB/pull/2033 +# https://issues.redhat.com/browse/RHEL-86470 +Patch3: tbb-2021-avoid-zero-threads.patch + BuildRequires: cmake BuildRequires: gcc-c++ BuildRequires: hwloc @@ -187,6 +191,10 @@ ctest --output-on-failure --force-new-ctest-process %{python3_sitearch}/__pycache__/TBB* %changelog +* Tue Apr 21 2026 Jonathan Wakely - 2021.11.0-8 +- Apply patch to fix hanging test on uniprocessor machines. + Resolves: RHEL-86470 + * Tue Oct 29 2024 Troy Dawson - 2021.11.0-7 - Bump release for October 2024 mass rebuild: Resolves: RHEL-64018