From 5a7bd898f9c53876063e60a6ee2734c85da7dc68 Mon Sep 17 00:00:00 2001 From: "Nysal Jan K.A" Date: Thu, 30 Jul 2015 19:52:40 +0530 Subject: [PATCH] Fix an invalid memory access in mrecv & imrecv After the call to PML mrecv/imrecv, the message handle is set to MPI_MESSAGE_NULL. Use the cached communicator while invoking the error handler. --- ompi/mpi/c/imrecv.c | 2 +- ompi/mpi/c/mrecv.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ompi/mpi/c/imrecv.c b/ompi/mpi/c/imrecv.c index ae955cfaaf5..35fed70022d 100644 --- a/ompi/mpi/c/imrecv.c +++ b/ompi/mpi/c/imrecv.c @@ -67,5 +67,5 @@ int MPI_Imrecv(void *buf, int count, MPI_Datatype type, OPAL_CR_ENTER_LIBRARY(); rc = MCA_PML_CALL(imrecv(buf, count, type, message, request)); - OMPI_ERRHANDLER_RETURN(rc, (*message)->comm, rc, FUNC_NAME); + OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME); } diff --git a/ompi/mpi/c/mrecv.c b/ompi/mpi/c/mrecv.c index 7f4ff1e5108..f9d2377e220 100644 --- a/ompi/mpi/c/mrecv.c +++ b/ompi/mpi/c/mrecv.c @@ -75,5 +75,5 @@ int MPI_Mrecv(void *buf, int count, MPI_Datatype type, opal_memchecker_base_mem_undefined(&status->MPI_ERROR, sizeof(int)); ); - OMPI_ERRHANDLER_RETURN(rc, (*message)->comm, rc, FUNC_NAME); + OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME); }