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

Guilherme Valarini via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Aug 25 10:36:31 PDT 2022


gValarini created this revision.
gValarini added reviewers: jdoerfert, ye-luo.
Herald added a project: All.
gValarini requested review of this revision.
Herald added a project: OpenMP.
Herald added a subscriber: openmp-commits.

The current mechanism using TIDs to delegate a map entry
ownership/deletion-responsibility during data ends can lead to
double-free and user-after-free problems. By tracking the threads that
uses the same entry on the targetDataEnd, we can delay the entry
deletion to be done by the last thread that leaves the targetDataEnd,
ensuring no double-free/user-after-free problems may occur.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D132676

Files:
  openmp/libomptarget/include/ExclusiveAccess.h
  openmp/libomptarget/include/device.h
  openmp/libomptarget/src/device.cpp
  openmp/libomptarget/src/omptarget.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132676.455642.patch
Type: text/x-patch
Size: 17445 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20220825/5b51826c/attachment-0001.bin>


More information about the Openmp-commits mailing list