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

goodell at mcs.anl.gov goodell at mcs.anl.gov
Wed Feb 23 12:38:54 CST 2011


Author: goodell
Date: 2011-02-23 12:38:53 -0600 (Wed, 23 Feb 2011)
New Revision: 8023

Modified:
   mpich2/trunk/src/include/mpiimpl.h
Log:
bugfix: r7971 broke the comm validity test (tt#1441)

This made test/mpi/errors/comm/cfree fail with a segfault.

No reviewer.

Modified: mpich2/trunk/src/include/mpiimpl.h
===================================================================
--- mpich2/trunk/src/include/mpiimpl.h	2011-02-23 04:36:26 UTC (rev 8022)
+++ mpich2/trunk/src/include/mpiimpl.h	2011-02-23 18:38:53 UTC (rev 8023)
@@ -463,9 +463,11 @@
 /* Check not only for a null pointer but for an invalid communicator,
    such as one that has been freed.  Let's try the ref_count as the test
    for now */
+/* ticket #1441: check (refcount<=0) to cover the case of 0, an "over-free" of
+ * -1 or similar, and the 0xecec... case when --enable-g=mem is used */
 #define MPID_Comm_valid_ptr(ptr,err) {                \
      MPID_Valid_ptr_class(Comm,ptr,MPI_ERR_COMM,err); \
-     if ((ptr) && MPIU_Object_get_ref(ptr) == 0) {    \
+     if ((ptr) && MPIU_Object_get_ref(ptr) <= 0) {    \
          MPIU_ERR_SET(err,MPI_ERR_COMM,"**comm");     \
          ptr = 0;                                     \
      }                                                \



More information about the mpich2-commits mailing list