Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
v4.0.x: Applying fixes from #8217
These are not my changes, but I'm trying to incorporate them
from the v4.0.x PR #8217.

v4.0.x version of master PR #8747

Not a cherry-pick (includes orte and openib changes)

Signed-off-by: Geoffrey Paulsen [email protected]
  • Loading branch information
gpaulsen committed Mar 31, 2021
commit 3a243ac8e98dcb36ae8986d7b32973944cf4cc9b
22 changes: 16 additions & 6 deletions ompi/mca/common/monitoring/common_monitoring.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,19 @@ int mca_common_monitoring_init( void )

void mca_common_monitoring_finalize( void )
{
if( ! mca_common_monitoring_enabled || /* Don't release if not last */
0 < opal_atomic_sub_fetch_32(&mca_common_monitoring_hold, 1) ) return;

/* Even if not enabled, this string is allocated at l.310 */
if (!mca_common_monitoring_enabled) {
if (NULL != mca_common_monitoring_current_filename) {
free(mca_common_monitoring_current_filename);
mca_common_monitoring_current_filename = NULL;
}
return;
}

/* Don't release if not last */
if (0 < opal_atomic_sub_fetch_32(&mca_common_monitoring_hold, 1))
return;

OPAL_MONITORING_PRINT_INFO("common_component_finish");
/* Dump monitoring informations */
mca_common_monitoring_flush(mca_common_monitoring_output_enabled,
Expand All @@ -241,11 +251,11 @@ void mca_common_monitoring_finalize( void )
opal_output_close(mca_common_monitoring_output_stream_id);
free(mca_common_monitoring_output_stream_obj.lds_prefix);
/* Free internal data structure */
free(pml_data); /* a single allocation */
opal_hash_table_remove_all( common_monitoring_translation_ht );
free(pml_data); /* a single allocation */
opal_hash_table_remove_all(common_monitoring_translation_ht);
OBJ_RELEASE(common_monitoring_translation_ht);
mca_common_monitoring_coll_finalize();
if( NULL != mca_common_monitoring_current_filename ) {
if (NULL != mca_common_monitoring_current_filename) {
free(mca_common_monitoring_current_filename);
mca_common_monitoring_current_filename = NULL;
}
Expand Down
1 change: 1 addition & 0 deletions ompi/mca/mtl/ofi/mtl_ofi.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ ompi_mtl_ofi_add_procs(struct mca_mtl_base_module_t *mtl,
goto bail;
}
memcpy(&ep_names[i*namelen], ep_name, namelen);
free(ep_name); // malloc'd inside OFI_COMPAT_MODEX_RECV in pmix3x.c:1097
}

/**
Expand Down
6 changes: 6 additions & 0 deletions ompi/mca/mtl/ofi/mtl_ofi_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,12 @@ ompi_mtl_ofi_finalize(struct mca_mtl_base_module_t *mtl)
goto finalize_err;
}

/* This was strdup()ed at L.714 */
if (NULL != ompi_mtl_ofi.provider_name) {
free(ompi_mtl_ofi.provider_name);
ompi_mtl_ofi.provider_name = NULL;
}

return OMPI_SUCCESS;

finalize_err:
Expand Down
17 changes: 17 additions & 0 deletions opal/mca/btl/openib/btl_openib_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,11 @@ static int btl_openib_component_close(void)
OBJ_DESTRUCT(&mca_btl_openib_component.srq_manager.lock);
OBJ_DESTRUCT(&mca_btl_openib_component.srq_manager.srq_addr_table);

/* destroy the tx/rx queues */
OBJ_DESTRUCT(&mca_btl_openib_component.send_free_coalesced);
OBJ_DESTRUCT(&mca_btl_openib_component.send_user_free);
OBJ_DESTRUCT(&mca_btl_openib_component.recv_user_free);

opal_btl_openib_connect_base_finalize();
opal_btl_openib_ini_finalize();

Expand Down Expand Up @@ -912,6 +917,7 @@ static void device_construct(mca_btl_openib_device_t *device)
device->ib_channel = NULL;
#endif
device->btls = 0;
device->allowed_btls = 0;
device->endpoints = NULL;
device->device_btls = NULL;
device->ib_cq[BTL_OPENIB_HP_CQ] = NULL;
Expand Down Expand Up @@ -1876,6 +1882,8 @@ static int init_one_device(opal_list_t *btl_list, struct ibv_device* ib_dev)
device->rcache =
mca_rcache_base_module_create (mca_btl_openib_component.ib_rcache_name,
device, &rcache_resources);
free(rcache_resources.cache_name);

if (NULL == device->rcache) {
/* Don't print an error message here -- we'll get one from
mpool_create anyway */
Expand Down Expand Up @@ -2277,6 +2285,7 @@ static int init_one_device(opal_list_t *btl_list, struct ibv_device* ib_dev)
} else if (device->btls > 0) {
/* no port is allowed to be used by btl/openib,
* so release the device right away */
OBJ_RELEASE(device->device_btls);
OBJ_RELEASE(device);
return OPAL_SUCCESS;
}
Expand All @@ -2292,6 +2301,7 @@ static int init_one_device(opal_list_t *btl_list, struct ibv_device* ib_dev)
if (NULL != allowed_ports) {
free(allowed_ports);
}
OBJ_RELEASE(device->device_btls);
OBJ_RELEASE(device);
return ret;
}
Expand Down Expand Up @@ -2704,6 +2714,7 @@ btl_openib_component_init(int *num_btl_modules,
}
}

// These are used nowhere else, ergo...
OBJ_CONSTRUCT(&mca_btl_openib_component.send_free_coalesced, opal_free_list_t);
OBJ_CONSTRUCT(&mca_btl_openib_component.send_user_free, opal_free_list_t);
OBJ_CONSTRUCT(&mca_btl_openib_component.recv_user_free, opal_free_list_t);
Expand Down Expand Up @@ -2733,6 +2744,7 @@ btl_openib_component_init(int *num_btl_modules,
goto no_btls;
}

free(init_data);
init_data = (mca_btl_openib_frag_init_data_t *) malloc(sizeof(mca_btl_openib_frag_init_data_t));
if (NULL == init_data) {
BTL_ERROR(("Failed malloc: %s:%d", __FILE__, __LINE__));
Expand All @@ -2754,6 +2766,7 @@ btl_openib_component_init(int *num_btl_modules,
goto no_btls;
}

free(init_data);
init_data = (mca_btl_openib_frag_init_data_t *) malloc(sizeof(mca_btl_openib_frag_init_data_t));
if (NULL == init_data) {
BTL_ERROR(("Failed malloc: %s:%d", __FILE__, __LINE__));
Expand All @@ -2773,6 +2786,8 @@ btl_openib_component_init(int *num_btl_modules,
goto no_btls;
}

free(init_data);

/* If fork support is requested, try to enable it */
if (OPAL_SUCCESS != (ret = opal_common_verbs_fork_test())) {
goto no_btls;
Expand Down Expand Up @@ -3058,6 +3073,8 @@ btl_openib_component_init(int *num_btl_modules,
if (NULL != btls) {
free(btls);
}

opal_ibv_free_device_list(ib_devs);
return NULL;
}

Expand Down
7 changes: 7 additions & 0 deletions opal/mca/btl/openib/btl_openib_ini.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,13 +358,15 @@ static int parse_line(parsed_section_values_t *sv)
if (0 == strcasecmp(key_buffer, "vendor_id")) {
if (OPAL_SUCCESS != (ret = opal_btl_openib_ini_intify_list(value, &sv->vendor_ids,
&sv->vendor_ids_len))) {
free(value);
return ret;
}
}

else if (0 == strcasecmp(key_buffer, "vendor_part_id")) {
if (OPAL_SUCCESS != (ret = opal_btl_openib_ini_intify_list(value, &sv->vendor_part_ids,
&sv->vendor_part_ids_len))) {
free(value);
return ret;
}
}
Expand Down Expand Up @@ -468,6 +470,11 @@ static void reset_section(bool had_previous_value, parsed_section_values_t *s)
if (NULL != s->vendor_part_ids) {
free(s->vendor_part_ids);
}
// This could be freed here, or had_previous_value forwarded to
// reset_values...
if (NULL != s->values.receive_queues) {
free(s->values.receive_queues);
}
}

s->name = NULL;
Expand Down
3 changes: 2 additions & 1 deletion opal/mca/mpool/hugepage/mpool_hugepage_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,8 @@ static void mca_mpool_hugepage_find_hugepages (void) {
opal_output_verbose (MCA_BASE_VERBOSE_INFO, opal_mpool_base_framework.framework_output,
"found huge page with size = %lu, path = %s, mmap flags = 0x%x, with invalid "
"permissions, skipping", hp->page_size, hp->path, hp->mmap_flags);
}
}
OBJ_RELEASE(hp);
}

opal_list_sort (&mca_mpool_hugepage_component.huge_pages, page_compare);
Expand Down
3 changes: 3 additions & 0 deletions orte/mca/ess/base/ess_base_fns.c
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,9 @@ int orte_ess_base_proc_binding(void)
}
}
}
} else {
/* Prevent cpus from being unfreed if we fall through */
hwloc_bitmap_free(cpus);
}
} else {
OPAL_OUTPUT_VERBOSE((5, orte_ess_base_framework.framework_output,
Expand Down
1 change: 1 addition & 0 deletions orte/util/show_help.c
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,7 @@ int orte_show_help_norender(const char *filename, const char *topic,
nanosleep(&tp, NULL);
}
OBJ_RELEASE(buf);
free(kv->data.bo.bytes);
kv->data.bo.bytes = NULL;
OPAL_LIST_DESTRUCT(&info);
rc = ORTE_SUCCESS;
Expand Down