[Openmp-commits] [openmp] r228736 - Fixed memory corruption problem.
Andrey Churbanov
Andrey.Churbanov at intel.com
Tue Feb 10 12:10:22 PST 2015
Author: achurbanov
Date: Tue Feb 10 14:10:21 2015
New Revision: 228736
URL: http://llvm.org/viewvc/llvm-project?rev=228736&view=rev
Log:
Fixed memory corruption problem.
Modified:
openmp/trunk/runtime/src/kmp_affinity.cpp
Modified: openmp/trunk/runtime/src/kmp_affinity.cpp
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_affinity.cpp?rev=228736&r1=228735&r2=228736&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_affinity.cpp (original)
+++ openmp/trunk/runtime/src/kmp_affinity.cpp Tue Feb 10 14:10:21 2015
@@ -350,6 +350,10 @@ public:
hierarchy_info() : depth(1), uninitialized(true) {}
void init(AddrUnsPair *adr2os, int num_addrs)
{
+ /* Added explicit initialization of the depth here to prevent usage of dirty value
+ observed when static library is re-initialized multiple times (e.g. when
+ non-OpenMP thread repeatedly launches/joins thread that uses OpenMP). */
+ depth = 1;
uninitialized = false;
for (kmp_uint32 i=0; i<maxLevels; ++i) { // init numPerLevel[*] to 1 item per level
numPerLevel[i] = 1;
More information about the Openmp-commits
mailing list