[llvm-bugs] [Bug 50519] New: Segfault when running nested parallels

via llvm-bugs llvm-bugs at lists.llvm.org
Fri May 28 06:35:39 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=50519

            Bug ID: 50519
           Summary: Segfault when running nested parallels
           Product: OpenMP
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Runtime Library
          Assignee: unassignedbugs at nondot.org
          Reporter: rpenacob at bsc.es
                CC: llvm-bugs at lists.llvm.org

I've got a segfault when running the following code. It does not always fail
though.

int main() {
  int j_size = 20;
  int k_size = 20;
  #pragma omp parallel num_threads(4)
  {
    #pragma omp parallel num_threads(2)
    for(int j=0; j<j_size; j++){
      #pragma omp task
      for(int k=0; k<k_size; k++){
      } 
    } 
  } 
}

I've compiled with 59a4ee97288b commit with Debug.
To compile: clang -fopenmp t1.c -o t1
To execute:
  export OMP_MAX_ACTIVE_LEVELS=2
  for i in {0..100}; do ./t1 ; done

And I see one thread is freeing a team in
https://github.com/llvm/llvm-project/blob/main/openmp/runtime/src/kmp_runtime.cpp#L2496
that is being used by other thread in
https://github.com/llvm/llvm-project/blob/main/openmp/runtime/src/kmp_tasking.cpp#L2788

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210528/0179180f/attachment.html>


More information about the llvm-bugs mailing list