1
1

btl/ugni: reorder teardown to avoid using freed memory

vagrind correctly indicated that the mpool is needed when tearing down
the free lists. Reordered the teardown code to correct this.

My code so no review required.

cmr=v1.8.2:reviewer=ompi-rm1.8

This commit was SVN r31780.
Этот коммит содержится в:
Nathan Hjelm 2014-05-15 16:58:28 +00:00
родитель 73bfecd650
Коммит d3dc2c9b0b

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

@ -164,16 +164,6 @@ mca_btl_ugni_module_finalize (struct mca_btl_base_module_t *btl)
if (GNI_RC_SUCCESS != rc) {
BTL_VERBOSE(("btl/ugni error destroying endpoint"));
}
if (NULL != ugni_module->smsg_mpool) {
(void) mca_mpool_base_module_destroy (ugni_module->smsg_mpool);
ugni_module->smsg_mpool = NULL;
}
if (NULL != ugni_module->super.btl_mpool) {
(void) mca_mpool_base_module_destroy (ugni_module->super.btl_mpool);
ugni_module->super.btl_mpool = NULL;
}
}
OBJ_DESTRUCT(&ugni_module->eager_frags_send);
@ -188,6 +178,19 @@ mca_btl_ugni_module_finalize (struct mca_btl_base_module_t *btl)
OBJ_DESTRUCT(&ugni_module->endpoints);
OBJ_DESTRUCT(&ugni_module->failed_frags);
if (ugni_module->initialized) {
/* need to tear down the mpools *after* the free lists */
if (NULL != ugni_module->smsg_mpool) {
(void) mca_mpool_base_module_destroy (ugni_module->smsg_mpool);
ugni_module->smsg_mpool = NULL;
}
if (NULL != ugni_module->super.btl_mpool) {
(void) mca_mpool_base_module_destroy (ugni_module->super.btl_mpool);
ugni_module->super.btl_mpool = NULL;
}
}
ugni_module->initialized = false;
return OMPI_SUCCESS;