Open MPI logo

Open MPI Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Development mailing list

Subject: [OMPI devel] MPI_Mrecv(..., MPI_STATUS_IGNORE) in Open MPI 1.7.1
From: Lisandro Dalcin (dalcinl_at_[hidden])
Date: 2013-05-01 04:56:24

It seems that Mrecv() tries to write on the status arg, even when it
is STATUS_IGNORE. Looking at the sources (pmrecv.c and pmprobe.c),
there are some memcheck code paths that access status but do not check
for STATUS_IGNORE, please review them.

$ cat tmp.c
#include <mpi.h>

int main(int argc, char *argv[])
  MPI_Message message;
  MPI_Init(&argc, &argv);
  message = MPI_MESSAGE_NO_PROC;
  MPI_Mrecv(NULL, 0, MPI_BYTE, &message, MPI_STATUS_IGNORE);
  return 0;

$ mpicc tmp.c
$ valgrind ./a.out
==17489== Invalid write of size 8
==17489== at 0x4CA811C: PMPI_Mrecv (pmrecv.c:62)
==17489== by 0x400816: main (in /tmp/a.out)
==17489== Address 0x0 is not stack'd, malloc'd or (recently) free'd
[localhost:17489] *** Process received signal ***
[localhost:17489] Signal: Segmentation fault (11)
[localhost:17489] Signal code: Address not mapped (1)
[localhost:17489] Failing at address: (nil)

Lisandro Dalcin
Predio CONICET-Santa Fe
Colectora RN 168 Km 472, Paraje El Pozo
3000 Santa Fe, Argentina
Tel: +54-342-4511594 (ext 1011)
Tel/Fax: +54-342-4511169