[mpich2-commits] r6699 - mpich2/trunk/src/include

goodell at mcs.anl.gov goodell at mcs.anl.gov
Thu May 20 22:34:46 CDT 2010


Author: goodell
Date: 2010-05-20 22:34:46 -0500 (Thu, 20 May 2010)
New Revision: 6699

Modified:
   mpich2/trunk/src/include/mpiimplthread.h
Log:
lazy init in THREADPRIV_GET can lead to recursive death-spiral

This can happen when there are failures at MPI_Init(_thread) time
because we use THREADPRIV macros in core services for error handling
and MPIU_Strerror.

No reviewer.

Modified: mpich2/trunk/src/include/mpiimplthread.h
===================================================================
--- mpich2/trunk/src/include/mpiimplthread.h	2010-05-21 03:34:43 UTC (rev 6698)
+++ mpich2/trunk/src/include/mpiimplthread.h	2010-05-21 03:34:46 UTC (rev 6699)
@@ -233,9 +233,6 @@
         if (!MPIR_Thread) {                                                         \
             if (MPIU_ISTHREADED) {                                                  \
                 MPID_Thread_tls_get(&MPIR_ThreadInfo.thread_storage, &MPIR_Thread); \
-                if (!MPIR_Thread) {                                                 \
-                    MPIU_THREADPRIV_INIT; /* subtle, sets MPIR_Thread */            \
-                }                                                                   \
             }                                                                       \
             else {                                                                  \
                 MPIR_Thread = &MPIR_ThreadSingle;                                   \
@@ -261,9 +258,6 @@
     do {                                                                        \
         if (!MPIR_Thread) {                                                     \
             MPID_Thread_tls_get(&MPIR_ThreadInfo.thread_storage, &MPIR_Thread); \
-            if (!MPIR_Thread) {                                                 \
-                MPIU_THREADPRIV_INIT; /* subtle, sets MPIR_Thread */            \
-            }                                                                   \
             MPIU_Assert(MPIR_Thread);                                           \
         }                                                                       \
     } while (0)



More information about the mpich2-commits mailing list