[llvm-branch-commits] [openmp] 9b7d6a6 - [OpenMP] Fix too long name for shm segment on macOS

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Dec 9 12:36:15 PST 2020


Author: Peyton, Jonathan L
Date: 2020-12-09T14:31:15-06:00
New Revision: 9b7d6a6bffce14c766eaa90c7a3d3b8d192cdfb0

URL: https://github.com/llvm/llvm-project/commit/9b7d6a6bffce14c766eaa90c7a3d3b8d192cdfb0
DIFF: https://github.com/llvm/llvm-project/commit/9b7d6a6bffce14c766eaa90c7a3d3b8d192cdfb0.diff

LOG: [OpenMP] Fix too long name for shm segment on macOS

Remove the user id component to the shm segment name and just use
the pid like before.

Differential Revision: https://reviews.llvm.org/D92660

Added: 
    

Modified: 
    openmp/runtime/src/kmp_runtime.cpp

Removed: 
    


################################################################################
diff  --git a/openmp/runtime/src/kmp_runtime.cpp b/openmp/runtime/src/kmp_runtime.cpp
index cdcfdb0be178..f6d4524150f0 100644
--- a/openmp/runtime/src/kmp_runtime.cpp
+++ b/openmp/runtime/src/kmp_runtime.cpp
@@ -6356,11 +6356,12 @@ static char *__kmp_registration_str = NULL;
 // Value to be saved in env var __KMP_REGISTERED_LIB_<pid>.
 
 static inline char *__kmp_reg_status_name() {
-  /* On RHEL 3u5 if linked statically, getpid() returns 
diff erent values in
-     each thread. If registration and unregistration go in 
diff erent threads
-     (omp_misc_other_root_exit.cpp test case), the name of registered_lib_env
-     env var can not be found, because the name will contain 
diff erent pid. */
-#if KMP_OS_UNIX && KMP_DYNAMIC_LIB // shared memory is with dynamic library
+/* On RHEL 3u5 if linked statically, getpid() returns 
diff erent values in
+   each thread. If registration and unregistration go in 
diff erent threads
+   (omp_misc_other_root_exit.cpp test case), the name of registered_lib_env
+   env var can not be found, because the name will contain 
diff erent pid. */
+// macOS* complains about name being too long with additional getuid()
+#if KMP_OS_UNIX && !KMP_OS_DARWIN && KMP_DYNAMIC_LIB
   return __kmp_str_format("__KMP_REGISTERED_LIB_%d_%d", (int)getpid(),
                           (int)getuid());
 #else


        


More information about the llvm-branch-commits mailing list