[MPICH] length of array passed to MPI_Type_set_name

Toon Knapen toon.knapen at fft.be
Fri Jul 13 09:32:25 CDT 2007


In mpich2-1.0.5p4/test/mpi/util/mtest.c on line 612, MPI_Type_set_name 
is called with a name for which the storage is shorter than 
MPI_MAX_OBJECT_NAME.

It is unclear to me though if MPI-2 does not require the array to be (at 
least) MPI_MAX_OBJECT_NAME characters long (including the 
null-terminator). For instance, the 2nd 'advice to users' on page 175 of 
MPI-2 says '... not a guarantee that setting names of less than this 
length will always succeed'.

Although I admit to find the paragraph I quoted above a bit confusing, I 
can imagine though that an MPI implementation might 
memcpy(internal_store,name_given_by_user,MPI_MAX_OBJECT_NAME). If in 
that case, 'name_given_by_user' is not MPI_MAX_OBJECT_NAME characters 
long, the memcpy might trigger a segmentation fault.

t

(It's really not my intention to annoy you guess with all my question. 
You guys are doing a great job and delivering a great library)




More information about the mpich-discuss mailing list