[Openmp-commits] [PATCH] D132676: [libomptarget] Avoid double-frees and user-after-frees of entries
Johannes Doerfert via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Wed Sep 7 10:34:29 PDT 2022
jdoerfert added inline comments.
================
Comment at: openmp/libomptarget/include/device.h:76
+ }
+};
+
----------------
Make a separate header, this is reusable.
================
Comment at: openmp/libomptarget/src/omptarget.cpp:687
+ DelEntry = false;
+ }
+
----------------
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.
```
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