From 33da6bd7f5031559fb366ed3c6524552007d6287 Mon Sep 17 00:00:00 2001 From: AndreyChurbanov Date: Wed, 11 Nov 2020 00:16:23 +0300 Subject: [PATCH] [OpenMP] Fixes for shared memory cleanup when aborts occur Patch by Erdner, Todd Differential Revision: https://reviews.llvm.org/D90974 --- openmp/runtime/src/kmp_runtime.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openmp/runtime/src/kmp_runtime.cpp b/openmp/runtime/src/kmp_runtime.cpp index 71a55e82476d..6ff11db1da4d 100644 --- a/openmp/runtime/src/kmp_runtime.cpp +++ b/openmp/runtime/src/kmp_runtime.cpp @@ -441,6 +441,7 @@ void __kmp_abort_process() { raise(SIGABRT); _exit(3); // Just in case, if signal ignored, exit anyway. } else { + __kmp_unregister_library(); abort(); } @@ -6170,6 +6171,7 @@ void __kmp_internal_end_library(int gtid_req) { if (__kmp_root[gtid]->r.r_active) { __kmp_global.g.g_abort = -1; TCW_SYNC_4(__kmp_global.g.g_done, TRUE); + __kmp_unregister_library(); KA_TRACE(10, ("__kmp_internal_end_library: root still active, abort T#%d\n", gtid));