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

Shilei Tian via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Sun Mar 20 20:33:34 PDT 2022


tianshilei1992 marked an inline comment as done.
tianshilei1992 added a comment.

In D122014#3393031 <https://reviews.llvm.org/D122014#3393031>, @jdoerfert wrote:

> Why don't we need the same for Streams?

Because we always sync the stream at the end of a target task, so it is guaranteed that streams are all released in user's code. However, this is not 100% correct. If we get a "dangling" `nowait` target task, the stream might not be released before the end of user code. Actually, even with this patch, that could still be a problem because we only have an implicit mandatory task wait when `libomp` is shut down. However, that function is called via `__attribute__((destructor))`, which means plugins have already been destroyed. That can cause a problem. I don't have a clear clue on how to solve it.


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