[Openmp-commits] [PATCH] D122014: [OpenMP][CUDA] Fix potential program crash caused by double free resources

Ye Luo via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Fri Mar 18 12:32:02 PDT 2022


ye-luo added inline comments.


================
Comment at: openmp/libomptarget/plugins/cuda/src/rtl.cpp:233
+  /// when a resource is released.
+  std::unordered_set<ElementTy> ResourcesGiven;
   /// A reference to the corresponding allocator.
----------------
How about check in every allocated resource from runtime in ResourcesGiven and then use Resources only for pool management. In this way, ResourcesGiven is fully responsible for ownership.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122014



More information about the Openmp-commits mailing list