[mpich2-dev] MPI_Aint fix for IntelANL2006 MPI_Keyval1 testcase

Jeff Parker jjparker at us.ibm.com
Tue Apr 22 16:25:49 CDT 2008


The following patch fixes the attribute copy routine within an IntelANL2006
testcase.  The problem was that the testcase assumed that the size of a
pointer and the size of an MPI_Aint were the same, causing the stack to
be clobbered.

Index: node.c
===================================================================
RCS
file: /BGP/CVS/bgp/system_tests/function/intelanl2006/MPITEST/Test/c/grp_ctxt_comm/functional/MPI_Keyval1/node.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- node.c      25 May 2007 14:56:00 -0000      1.1
+++ node.c      22 Apr 2008 21:14:38 -0000      1.2
@@ -59,7 +59,7 @@
     /* According to an MPICH note, if (sizeof(int) < sizeof(void *), then
just
        setting the int part of attribute_val_out may leave some dirty
bits,
        so in C we need to typecast this just in case.  */
-    *(MPI_Aint *)attribute_val_out = (MPI_Aint)attribute_val_in;
+    *(void**)attribute_val_out = attribute_val_in;
     *flag = 1;
     *(MPI_Aint *)extra_state = *(MPI_Aint *)extra_state + 1;
     return MPI_SUCCESS;

Jeff Parker
IBM Blue Gene Messaging
jjparker at us.ibm.com




More information about the mpich2-dev mailing list