Skip to content

Commit

Permalink
ch4: add missing MPIDIG_request_init
Browse files Browse the repository at this point in the history
In MPIDIG_do_irecv when ch4-layer pre-allocates the request and the recv
matches unexpected queue, it was missing MPIDIG_request_init, causing
later reference to segfault.
  • Loading branch information
hzhou committed Jun 6, 2022
1 parent bd68fc7 commit c0234e4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/mpid/ch4/src/mpidig_recv.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,11 @@ MPL_STATIC_INLINE_PREFIX int MPIDIG_do_irecv(void *buf, MPI_Aint count, MPI_Data
* Record the passed `*request` to `match_req` so that we can complete it
* later when `unexp_req` completes.
* See MPIDI_recv_target_cmpl_cb for actual completion handler. */
MPIDIG_request_init(*request, vci, -1);
if (!(*request)->comm) {
(*request)->comm = comm;
MPIR_Comm_add_ref(comm);
}
MPIDIG_REQUEST(unexp_req, req->rreq.match_req) = *request;
}
MPIDIG_REQUEST(unexp_req, req->status) &= ~MPIDIG_REQ_UNEXPECTED;
Expand All @@ -246,6 +251,11 @@ MPL_STATIC_INLINE_PREFIX int MPIDIG_do_irecv(void *buf, MPI_Aint count, MPI_Data
/* Enqueuing path: CH4 already allocated request as `*request`.
* Since the real operations has completed in `unexp_req`, here we
* simply copy the status to `*request` and complete it. */
MPIDIG_request_init(*request, vci, -1);
if (!(*request)->comm) {
(*request)->comm = comm;
MPIR_Comm_add_ref(comm);
}
(*request)->status = unexp_req->status;
MPIR_Request_add_ref(*request);
MPID_Request_complete(*request);
Expand Down

0 comments on commit c0234e4

Please sign in to comment.