1
1

Fix a bug in the ob1 optimizations that can cause a segfault.

btl sendi functions currently can not handle the descriptor being NULL. The
send inline optimization was assuming (incorrectly) that NULL was ok.

cmr=v1.7.5:ticket=trac:4149

This commit was SVN r30364.

The following Trac tickets were found above:
  Ticket 4149 --> https://svn.open-mpi.org/trac/ompi/ticket/4149
Этот коммит содержится в:
Nathan Hjelm 2014-01-22 16:31:58 +00:00
родитель 1a021b8f2d
Коммит 66b69da394

Просмотреть файл

@ -62,6 +62,7 @@ static inline int mca_pml_ob1_send_inline (void *buf, size_t count,
ompi_proc_t *dst_proc, mca_bml_base_endpoint_t* endpoint,
ompi_communicator_t * comm)
{
mca_btl_base_descriptor_t *des = NULL;
mca_pml_ob1_match_hdr_t match;
mca_bml_base_btl_t *bml_btl;
OPAL_PTRDIFF_TYPE lb, extent;
@ -86,8 +87,6 @@ static inline int mca_pml_ob1_send_inline (void *buf, size_t count,
opal_convertor_copy_and_prepare_for_send (dst_proc->proc_convertor,
(const struct opal_datatype_t *) datatype,
count, buf, 0, &convertor);
/* find out the packed size of the data */
opal_convertor_get_packed_size (&convertor, &size);
}
@ -100,12 +99,16 @@ static inline int mca_pml_ob1_send_inline (void *buf, size_t count,
/* try to send immediately */
rc = mca_bml_base_sendi (bml_btl, &convertor, &match, OMPI_PML_OB1_MATCH_HDR_LEN,
size, MCA_BTL_NO_ORDER, MCA_BTL_DES_FLAGS_PRIORITY | MCA_BTL_DES_FLAGS_BTL_OWNERSHIP,
MCA_PML_OB1_HDR_TYPE_MATCH, NULL);
MCA_PML_OB1_HDR_TYPE_MATCH, &des);
if (count > 0) {
opal_convertor_cleanup (&convertor);
}
if (OPAL_UNLIKELY(OMPI_SUCCESS != rc)) {
if (des) {
mca_bml_base_free (bml_btl, des);
}
return rc;
}