mpich
mpich copied to clipboard
comm: Segmentation fault in MPI_Intercomm_create_from_groups
According to MPI 4.1 (Section 7.6, p. 355), MPI_Intercomm_create_from_groups should be a local operation and return MPI_COMM_NULL if MPI_GROUP_EMPTY is supplied as the local_group or remote_group or both. However, MPICH 4.2.0rc2 crashes with a segmentation fault in this case. Please find a minimal reproducer below. (Note that this is the "extreme" case with both groups being empty. The segfault also occurs if one of the two groups is non-empty.)
#include <mpi.h>
int main(int argc, char** argv)
{
MPI_Init(&argc, &argv);
MPI_Comm newcomm;
MPI_Intercomm_create_from_groups(MPI_GROUP_EMPTY, 0,
MPI_GROUP_EMPTY, 0,
"42",
MPI_INFO_NULL,
MPI_ERRORS_ARE_FATAL,
&newcomm);
if (newcomm != MPI_COMM_NULL)
{
MPI_Comm_free(&newcomm);
}
MPI_Finalize();
return 0;
}
Thanks for the bug report. Fixed in #6903.