Skip to content

Commit d71fe93

Browse files
committed
pml/cm: fix buffer usage in MCA_PML_CM_HVY_SEND_REQUEST_BSEND_ALLOC()
In MCA_PML_CM_HVY_SEND_REQUEST_BSEND_ALLOC(), after call to opal_convert_pack() will changed convertor's status, the convertor need to be reset to original state. This is achieved by calling opal_convertor_prepare_for_send(), and it should be called with original send buffer provided by application, which is sendreq->req_addr. However, prior to this change, the function was called with sendreq->req_buff, which is the temprary buffer used for send. As a result, when the same request is used the 2nd time, wrong data was copied to outgoing buffer, and caused memory corrupiton. This patch addressed the issue. Signed-off-by: Wei Zhang <wzam@amazon.com>
1 parent 6cb2144 commit d71fe93

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ompi/mca/pml/cm/pml_cm_sendreq.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ do { \
381381
&max_data ); \
382382
opal_convertor_prepare_for_send( &sendreq->req_send.req_base.req_convertor, \
383383
&(ompi_mpi_packed.dt.super), \
384-
max_data, sendreq->req_buff ); \
384+
max_data, sendreq->req_addr ); \
385385
} \
386386
} \
387387
} while(0);

0 commit comments

Comments
 (0)