<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Fulfilling event inside task causes deadlock"
   href="https://bugs.llvm.org/show_bug.cgi?id=45904">45904</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Fulfilling event inside task causes deadlock
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>OpenMP
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Runtime Library
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>schuchart@hlrs.de
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=23479" name="attach_23479" title="Minimal example">attachment 23479</a> <a href="attachment.cgi?id=23479&action=edit" title="Minimal example">[details]</a></span>
Minimal example

A task with the detach clause is not completed if the event is fulfilled inside
the task itself before its execution terminates.

Attached is a minimal example (provided by Joachim Protze) to demonstrate this.
The execution deadlocks with the task waiting in the taskwait construct:

#0  0x00007ffff78ccd15 in __kmp_remove_my_task (thread=0x624600, gtid=0,
task_team=0x6278c0, is_constrained=1)
    at openmp/runtime/src/kmp_tasking.cpp:2588
#1  0x00007ffff78d3131 in __kmp_execute_tasks_template<kmp_flag_32>
(thread=0x624600, gtid=0, flag=0x7fffffffd260, final_spin=0,
thread_finished=0x7fffffffd28c, itt_sync_obj=0x0, 
    is_constrained=1) at openmp/runtime/src/kmp_tasking.cpp:2827
#2  0x00007ffff78cd6c3 in __kmp_execute_tasks_32 (thread=0x624600, gtid=0,
flag=0x7fffffffd260, final_spin=0, thread_finished=0x7fffffffd28c,
itt_sync_obj=0x0, is_constrained=1)
    at openmp/runtime/src/kmp_tasking.cpp:3002
#3  0x00007ffff78d4772 in kmp_flag_32::execute_tasks (this=0x7fffffffd260,
this_thr=0x624600, gtid=0, final_spin=0, thread_finished=0x7fffffffd28c,
itt_sync_obj=0x0, is_constrained=1)
    at openmp/runtime/src/kmp_wait_release.h:753
#4  0x00007ffff78d2ed7 in __kmpc_omp_taskwait_template<false>
(loc_ref=0x7fffffffd328, gtid=0, frame_address=0x0, return_address=0x0)
    at openmp/runtime/src/kmp_tasking.cpp:1863
#5  0x00007ffff78cb8e9 in __kmpc_omp_taskwait (loc_ref=0x7fffffffd328, gtid=0)
at openmp/runtime/src/kmp_tasking.cpp:1923
#6  0x00000000004009e9 in .omp_outlined._debug__ (.global_tid.=0x7fffffffd390,
.bound_tid.=0x7fffffffd388) at test_omp_detach_taskwait.c:13
#7  0x0000000000400abd in .omp_outlined..1 (.global_tid.=0x7fffffffd390,
.bound_tid.=0x7fffffffd388) at test_omp_detach_taskwait.c:5
#8  0x00007ffff793c113 in __kmp_invoke_microtask () at
openmp/runtime/src/z_Linux_asm.S:1166
#9  0x00007ffff78a4fb0 in __kmp_fork_call (loc=0x7fffffffd740, gtid=0,
call_context=fork_context_intel, argc=0, microtask=0x400aa0 <.omp_outlined..1>, 
    invoker=0x7ffff78b13ad <__kmp_invoke_task_func(int)>, ap=0x7fffffffd628) at
openmp/runtime/src/kmp_runtime.cpp:1887
#10 0x00007ffff7892890 in __kmpc_fork_call (loc=0x7fffffffd740, argc=0,
microtask=0x400aa0 <.omp_outlined..1>)
    at openmp/runtime/src/kmp_csupport.cpp:308
#11 0x00000000004008cb in main () at test_omp_detach_taskwait.c:5


Clang and libomp were built from git-72edb7986a8059cda12b808aa68828af88a0a1eb</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>