Skip to content

Commit d224268

Browse files
committed
request: Fix multiple calls to ompi_request_complete()
A second call to ompi_request_complete() segfaults. Make it mostly an non-op. Alternatively, the second invocation could generate an error, but let's play safe for now. Signed-off-by: Lisandro Dalcin <[email protected]>
1 parent ee16107 commit d224268

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ompi/request/request.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ static inline int ompi_request_complete(ompi_request_t* request, bool with_signa
532532

533533
ompi_wait_sync_t *tmp_sync = (ompi_wait_sync_t *) OPAL_ATOMIC_SWAP_PTR(&request->req_complete,
534534
REQUEST_COMPLETED);
535-
if( REQUEST_PENDING != tmp_sync ) {
535+
if (REQUEST_PENDING != tmp_sync && REQUEST_COMPLETED != tmp_sync) {
536536
wait_sync_update(tmp_sync, 1, request->req_status.MPI_ERROR);
537537
}
538538
} else {

0 commit comments

Comments
 (0)