[all-commits] [llvm/llvm-project] d23131: [OpenMP] Fix race condition in the completion/free...

Joachim via All-commits all-commits at lists.llvm.org
Sun May 17 03:28:58 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: d23131a3c063830e3d8d4f7d43cbcf95d92db3d3
      https://github.com/llvm/llvm-project/commit/d23131a3c063830e3d8d4f7d43cbcf95d92db3d3
  Author: Joachim Protze <protze at itc.rwth-aachen.de>
  Date:   2020-05-17 (Sun, 17 May 2020)

  Changed paths:
    M openmp/runtime/src/kmp_tasking.cpp

  Log Message:
  -----------
  [OpenMP] Fix race condition in the completion/freeing of detached tasks

Spurious assertion failures are symptoms of a race condition for the handling
of detached tasks:
Assertion failure at kmp_tasking.cpp(3744): taskdata->td_flags.complete == 1.
Assertion failure at kmp_tasking.cpp(710): taskdata->td_flags.executing == 0.

in the case of detach=true, all accesses to taskdata in __kmp_task_finish need
to happen before (~line 873):

taskdata->td_flags.proxy = TASK_PROXY;

This assignment signals to __kmp_fulfill_event, that the task will need to be
freed there. So, conceptionally the ownership of taskdata is moved.

Reviewed By: AndreyChurbanov

Differential Revision: https://reviews.llvm.org/D79702




More information about the All-commits mailing list