[Openmp-commits] [openmp] [openmp] Segfaults/assertion errors on certain omp statements after calling `omp_pause_resource_all(omp_pause_hard)` (PR #154204)

via Openmp-commits openmp-commits at lists.llvm.org
Thu Sep 4 11:50:07 PDT 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions h,c,cpp -- openmp/runtime/src/kmp.h openmp/runtime/src/kmp_csupport.cpp openmp/runtime/src/kmp_global.cpp openmp/runtime/src/kmp_lock.cpp openmp/runtime/src/kmp_lock.h openmp/runtime/src/kmp_runtime.cpp openmp/runtime/src/ompt-internal.h openmp/runtime/src/z_Linux_util.cpp openmp/runtime/test/api/omp_pause_resource.c
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/openmp/runtime/test/api/omp_pause_resource.c b/openmp/runtime/test/api/omp_pause_resource.c
index fce83824d..6154377b9 100644
--- a/openmp/runtime/test/api/omp_pause_resource.c
+++ b/openmp/runtime/test/api/omp_pause_resource.c
@@ -16,9 +16,13 @@ void doOmpWorkWithCritical(int *a_lockCtr, int *b_lockCtr) {
 #pragma omp parallel num_threads(NUM_THREADS)
   {
 #pragma omp critical(a_lock)
-    { *a_lockCtr = *a_lockCtr + 1; }
+    {
+      *a_lockCtr = *a_lockCtr + 1;
+    }
 #pragma omp critical(b_lock)
-    { *b_lockCtr = *b_lockCtr + 1; }
+    {
+      *b_lockCtr = *b_lockCtr + 1;
+    }
   }
 }
 
@@ -47,7 +51,8 @@ void test_omp_get_thread_num_after_omp_hard_pause_resource_all() {
 
 // use omp to do some work, guarantees omp initialization
 #pragma omp parallel num_threads(NUM_THREADS)
-  {}
+  {
+  }
 
   // omp hard pause should succeed
   int rc = omp_pause_resource_all(omp_pause_hard);
@@ -62,7 +67,8 @@ void test_omp_get_thread_num_after_omp_hard_pause_resource_all() {
 void test_omp_parallel_num_threads_after_omp_hard_pause_resource_all() {
 // use omp to do some work
 #pragma omp parallel num_threads(NUM_THREADS)
-  {}
+  {
+  }
 
   // omp hard pause should succeed
   int rc = omp_pause_resource_all(omp_pause_hard);
@@ -70,7 +76,8 @@ void test_omp_parallel_num_threads_after_omp_hard_pause_resource_all() {
 
 // this should not trigger any omp asserts
 #pragma omp parallel num_threads(NUM_THREADS)
-  {}
+  {
+  }
 }
 
 void test_KMP_INIT_AT_FORK_with_fork_after_omp_hard_pause_resource_all() {
@@ -106,7 +113,8 @@ void test_KMP_INIT_AT_FORK_with_fork_after_omp_hard_pause_resource_all() {
 void test_fork_child_exiting_after_omp_hard_pause_resource_all() {
 // use omp to do some work
 #pragma omp parallel num_threads(NUM_THREADS)
-  {}
+  {
+  }
 
   // omp hard pause should succeed
   int rc = omp_pause_resource_all(omp_pause_hard);

``````````

</details>


https://github.com/llvm/llvm-project/pull/154204


More information about the Openmp-commits mailing list