Skip to content

Commit e73ab93

Browse files
committed
pml/ob1: do not access fragment after calling btl rget
This commit fixes a bug that occurs when the btl callback happens before the rget returns. In this case the fragment has been returned and is no longer valid. This commit saves the size before calling rget. This is valid since the BTL is not allowed to change the read size. Fixes #3821 Signed-off-by: Nathan Hjelm <[email protected]>
1 parent 6570374 commit e73ab93

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ompi/mca/pml/ob1/pml_ob1_recvreq.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* Copyright (c) 2008 UT-Battelle, LLC. All rights reserved.
1414
* Copyright (c) 2011 Sandia National Laboratories. All rights reserved.
1515
* Copyright (c) 2012-2015 NVIDIA Corporation. All rights reserved.
16-
* Copyright (c) 2011-2016 Los Alamos National Security, LLC. All rights
16+
* Copyright (c) 2011-2017 Los Alamos National Security, LLC. All rights
1717
* reserved.
1818
* Copyright (c) 2012 FUJITSU LIMITED. All rights reserved.
1919
* Copyright (c) 2014-2016 Research Organization for Information Science
@@ -753,13 +753,14 @@ void mca_pml_ob1_recv_request_progress_rget( mca_pml_ob1_recv_request_t* recvreq
753753
frag->rdma_length = bytes_remaining;
754754
}
755755

756+
prev_sent = frag->rdma_length;
757+
756758
/* NTH: TODO -- handle error conditions gracefully */
757759
rc = mca_pml_ob1_recv_request_get_frag(frag);
758760
if (OMPI_SUCCESS != rc) {
759761
break;
760762
}
761763

762-
prev_sent = frag->rdma_length;
763764
bytes_remaining -= prev_sent;
764765
offset += prev_sent;
765766
}

0 commit comments

Comments
 (0)