[Openmp-commits] [PATCH] D132676: [libomptarget] Avoid double-frees and user-after-frees of entries

Ye Luo via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Wed Sep 7 10:49:04 PDT 2022


ye-luo added inline comments.


================
Comment at: openmp/libomptarget/src/omptarget.cpp:687
+    DelEntry = false;
+  }
+
----------------
jdoerfert wrote:
> I think, this can leave an entry intact on the device:
> ```
> T1: arrives here, TPR is still life so DeleterThreadCount is 3, won't destory the entry, HDTTMap is released.
> T2: arrives here, TPR is still life so DeleterThreadCount is 3, won't destory the entry. HDTTMap is released.
> Both exit this function, TPRs are destroyed, DeleterThreadCount is decremented twice and reaches 1, but nobody executing the code that would delete the entry.
> ```
Can this be protected by not calling HDTTMap.destroy()?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D132676/new/

https://reviews.llvm.org/D132676



More information about the Openmp-commits mailing list