From 0bdc594b2e5b7c11bbbe376d28e599e1106e0641 Mon Sep 17 00:00:00 2001 From: Gilles Gouaillardet Date: Mon, 23 Jan 2017 16:54:01 +0900 Subject: [PATCH 01/12] rml/base: plug a memory leak in orte_rml_API_recv_cancel() simply return when the orte event thread has gone Signed-off-by: Gilles Gouaillardet --- orte/mca/rml/base/rml_base_stubs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/orte/mca/rml/base/rml_base_stubs.c b/orte/mca/rml/base/rml_base_stubs.c index aaf61500ba..9197e10423 100644 --- a/orte/mca/rml/base/rml_base_stubs.c +++ b/orte/mca/rml/base/rml_base_stubs.c @@ -6,7 +6,7 @@ * reserved. * Copyright (c) 2013 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2014-2016 Intel Corporation. All rights reserved. - * Copyright (c) 2015-2016 Research Organization for Information Science + * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -312,6 +312,10 @@ void orte_rml_API_recv_cancel(orte_process_name_t* peer, orte_rml_tag_t tag) "%s rml_recv_cancel for peer %s tag %d", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), ORTE_NAME_PRINT(peer), tag); + if (!orte_event_base_active) { + /* no event will be processed any more, so simply return. */ + return; + } /* push the request into the event base so we can remove * the receive from our list of posted recvs */ From 9d6e0482a63932053f19cc5472a29451ffd7ec84 Mon Sep 17 00:00:00 2001 From: Gilles Gouaillardet Date: Mon, 23 Jan 2017 13:58:48 +0900 Subject: [PATCH 02/12] orte/data_server: plug a memory leak in orte_data_server() Signed-off-by: Gilles Gouaillardet --- orte/runtime/orte_data_server.c | 1 + 1 file changed, 1 insertion(+) diff --git a/orte/runtime/orte_data_server.c b/orte/runtime/orte_data_server.c index 1e9ca7a625..807f13f591 100644 --- a/orte/runtime/orte_data_server.c +++ b/orte/runtime/orte_data_server.c @@ -493,6 +493,7 @@ void orte_data_server(int status, orte_process_name_t* sender, OPAL_OUTPUT_VERBOSE((1, orte_debug_output, "%s data server:lookup: pushing request to wait", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME))); + OBJ_RELEASE(answer); req = OBJ_NEW(orte_data_req_t); req->room_number = room_number; req->requestor = *sender; From d0629f18c287910fd42e4590f89416937b18853c Mon Sep 17 00:00:00 2001 From: Gilles Gouaillardet Date: Wed, 11 Jan 2017 09:19:27 +0900 Subject: [PATCH 03/12] coll/libnbc: optimize size one communicators simply "return" with ompi_request_empty if the communicator size is 1 Signed-off-by: Gilles Gouaillardet --- ompi/mca/coll/libnbc/nbc_iallgather.c | 6 +++++- ompi/mca/coll/libnbc/nbc_iallreduce.c | 24 ++++++++++++++---------- ompi/mca/coll/libnbc/nbc_ibcast.c | 7 ++++++- ompi/mca/coll/libnbc/nbc_ireduce.c | 13 +++++++------ 4 files changed, 32 insertions(+), 18 deletions(-) diff --git a/ompi/mca/coll/libnbc/nbc_iallgather.c b/ompi/mca/coll/libnbc/nbc_iallgather.c index 9f0fea3706..c6cf9d69b4 100644 --- a/ompi/mca/coll/libnbc/nbc_iallgather.c +++ b/ompi/mca/coll/libnbc/nbc_iallgather.c @@ -5,7 +5,7 @@ * Corporation. All rights reserved. * Copyright (c) 2006 The Technical University of Chemnitz. All * rights reserved. - * Copyright (c) 2014-2016 Research Organization for Information Science + * Copyright (c) 2014-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2015 Los Alamos National Security, LLC. All rights * reserved. @@ -74,6 +74,10 @@ int ompi_coll_libnbc_iallgather(const void* sendbuf, int sendcount, MPI_Datatype return res; } } + if (1 == p) { + *request = &ompi_request_empty; + return OMPI_SUCCESS; + } #ifdef NBC_CACHE_SCHEDULE /* search schedule in communicator specific tree */ diff --git a/ompi/mca/coll/libnbc/nbc_iallreduce.c b/ompi/mca/coll/libnbc/nbc_iallreduce.c index 0b624f90c4..0e267d11dc 100644 --- a/ompi/mca/coll/libnbc/nbc_iallreduce.c +++ b/ompi/mca/coll/libnbc/nbc_iallreduce.c @@ -7,7 +7,7 @@ * rights reserved. * Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2014-2016 Research Organization for Information Science + * Copyright (c) 2014-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * * Author(s): Torsten Hoefler @@ -82,6 +82,19 @@ int ompi_coll_libnbc_iallreduce(const void* sendbuf, void* recvbuf, int count, M return res; } + if (1 == p) { + if (!inplace) { + /* for a single node - copy data to receivebuf */ + res = NBC_Copy(sendbuf, count, datatype, recvbuf, count, datatype, comm); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + NBC_Return_handle (handle); + return res; + } + } + *request = &ompi_request_empty; + return OMPI_SUCCESS; + } + res = NBC_Init_handle (comm, &handle, libnbc_module); if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { return res; @@ -94,15 +107,6 @@ int ompi_coll_libnbc_iallreduce(const void* sendbuf, void* recvbuf, int count, M return OMPI_ERR_OUT_OF_RESOURCE; } - if ((p == 1) && !inplace) { - /* for a single node - copy data to receivebuf */ - res = NBC_Copy(sendbuf, count, datatype, recvbuf, count, datatype, comm); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - NBC_Return_handle (handle); - return res; - } - } - /* algorithm selection */ if(p < 4 || size*count < 65536 || !ompi_op_is_commute(op) || inplace) { alg = NBC_ARED_BINOMIAL; diff --git a/ompi/mca/coll/libnbc/nbc_ibcast.c b/ompi/mca/coll/libnbc/nbc_ibcast.c index 840e6cdce9..b2ef870dce 100644 --- a/ompi/mca/coll/libnbc/nbc_ibcast.c +++ b/ompi/mca/coll/libnbc/nbc_ibcast.c @@ -5,7 +5,7 @@ * Corporation. All rights reserved. * Copyright (c) 2006 The Technical University of Chemnitz. All * rights reserved. - * Copyright (c) 2014-2015 Research Organization for Information Science + * Copyright (c) 2014-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2015 Los Alamos National Security, LLC. All rights * reserved. @@ -58,6 +58,11 @@ int ompi_coll_libnbc_ibcast(void *buffer, int count, MPI_Datatype datatype, int rank = ompi_comm_rank (comm); p = ompi_comm_size (comm); + if (1 == p) { + *request = &ompi_request_empty; + return OMPI_SUCCESS; + } + res = ompi_datatype_type_size(datatype, &size); if (MPI_SUCCESS != res) { NBC_Error("MPI Error in ompi_datatype_type_size() (%i)", res); diff --git a/ompi/mca/coll/libnbc/nbc_ireduce.c b/ompi/mca/coll/libnbc/nbc_ireduce.c index cf3f18b19e..342c15fc29 100644 --- a/ompi/mca/coll/libnbc/nbc_ireduce.c +++ b/ompi/mca/coll/libnbc/nbc_ireduce.c @@ -7,7 +7,7 @@ * rights reserved. * Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2014-2016 Research Organization for Information Science + * Copyright (c) 2014-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * * Author(s): Torsten Hoefler @@ -80,12 +80,13 @@ int ompi_coll_libnbc_ireduce(const void* sendbuf, void* recvbuf, int count, MPI_ } /* only one node -> copy data */ - if ((p == 1) && !inplace) { - res = NBC_Copy (sendbuf, count, datatype, recvbuf, count, datatype, comm); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - return res; + if (p == 1) { + if (!inplace) { + res = NBC_Copy (sendbuf, count, datatype, recvbuf, count, datatype, comm); + if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { + return res; + } } - *request = &ompi_request_empty; return OMPI_SUCCESS; } From 1a6c17ec7d4d77ac72ed78cd7d5aba0f739b1f93 Mon Sep 17 00:00:00 2001 From: Gilles Gouaillardet Date: Wed, 11 Jan 2017 13:04:24 +0900 Subject: [PATCH 04/12] opal/util: plug a memory leak by using opal_setenv() instead of putenv() Signed-off-by: Gilles Gouaillardet --- opal/util/cmd_line.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/opal/util/cmd_line.c b/opal/util/cmd_line.c index bac3430344..f3383490e6 100644 --- a/opal/util/cmd_line.c +++ b/opal/util/cmd_line.c @@ -13,7 +13,7 @@ * Copyright (c) 2012-2016 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2012-2015 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2015 Research Organization for Information Science + * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2016 Intel, Inc. All rights reserved * $COPYRIGHT$ @@ -35,6 +35,7 @@ #include "opal/util/argv.h" #include "opal/util/cmd_line.h" #include "opal/util/output.h" +#include "opal/util/opal_environ.h" #include "opal/mca/base/mca_base_var.h" #include "opal/constants.h" @@ -1158,7 +1159,6 @@ static int set_dest(cmd_line_option_t *option, char *sval) { int ival = atol(sval); long lval = strtoul(sval, NULL, 10); - char *str = NULL; size_t i; /* Set MCA param. We do this in the environment because the MCA @@ -1176,17 +1176,14 @@ static int set_dest(cmd_line_option_t *option, char *sval) case OPAL_CMD_LINE_TYPE_STRING: case OPAL_CMD_LINE_TYPE_INT: case OPAL_CMD_LINE_TYPE_SIZE_T: - asprintf(&str, "%s=%s", option->clo_mca_param_env_var, sval); + opal_setenv(option->clo_mca_param_env_var, sval, true, &environ); break; case OPAL_CMD_LINE_TYPE_BOOL: - asprintf(&str, "%s=1", option->clo_mca_param_env_var); + opal_setenv(option->clo_mca_param_env_var, "1", true, &environ); break; default: break; } - if (NULL != str) { - putenv(str); - } } /* Set variable */ From 501eb8dc7edf6d5cbdbba091ae2395c14325993d Mon Sep 17 00:00:00 2001 From: Gilles Gouaillardet Date: Tue, 24 Jan 2017 09:13:19 +0900 Subject: [PATCH 05/12] ompio: plug misc memory leaks Signed-off-by: Gilles Gouaillardet --- ompi/mca/common/ompio/common_ompio_file_open.c | 8 ++++++-- ompi/mca/io/ompio/io_ompio_aggregators.c | 8 +++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ompi/mca/common/ompio/common_ompio_file_open.c b/ompi/mca/common/ompio/common_ompio_file_open.c index 3be54ce27f..2602347e82 100644 --- a/ompi/mca/common/ompio/common_ompio_file_open.c +++ b/ompi/mca/common/ompio/common_ompio_file_open.c @@ -10,7 +10,7 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2008-2017 University of Houston. All rights reserved. - * Copyright (c) 2015 Research Organization for Information Science + * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2016 Cisco Systems, Inc. All rights reserved. * $COPYRIGHT$ @@ -307,6 +307,10 @@ int mca_common_ompio_file_close (mca_io_ompio_file_t *ompio_fh) ompio_fh->f_io_array = NULL; } + if (NULL != ompio_fh->f_init_aggr_list) { + free (ompio_fh->f_init_aggr_list); + ompio_fh->f_init_aggr_list = NULL; + } if (NULL != ompio_fh->f_init_procs_in_group) { free (ompio_fh->f_init_procs_in_group); ompio_fh->f_init_procs_in_group = NULL; @@ -358,7 +362,7 @@ int mca_common_ompio_file_close (mca_io_ompio_file_t *ompio_fh) } - if (MPI_COMM_NULL != ompio_fh->f_comm && (ompio_fh->f_flags & OMPIO_SHAREDFP_IS_SET) ) { + if (MPI_COMM_NULL != ompio_fh->f_comm) { ompi_comm_free (&ompio_fh->f_comm); } diff --git a/ompi/mca/io/ompio/io_ompio_aggregators.c b/ompi/mca/io/ompio/io_ompio_aggregators.c index ba32590521..504575d5dc 100644 --- a/ompi/mca/io/ompio/io_ompio_aggregators.c +++ b/ompi/mca/io/ompio/io_ompio_aggregators.c @@ -13,7 +13,7 @@ * Copyright (c) 2008-2016 University of Houston. All rights reserved. * Copyright (c) 2011-2015 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2012-2013 Inria. All rights reserved. - * Copyright (c) 2015-2016 Research Organization for Information Science + * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -315,6 +315,9 @@ int mca_io_ompio_finalize_initial_grouping(mca_io_ompio_file_t *fh, int y = 0; fh->f_init_num_aggrs = num_groups; + if (NULL != fh->f_init_aggr_list) { + free(fh->f_init_aggr_list); + } fh->f_init_aggr_list = (int*)malloc (fh->f_init_num_aggrs * sizeof(int)); if (NULL == fh->f_init_aggr_list) { opal_output (1, "OUT OF MEMORY\n"); @@ -325,6 +328,9 @@ int mca_io_ompio_finalize_initial_grouping(mca_io_ompio_file_t *fh, for( y = 0; y < contg_groups[z].procs_per_contg_group; y++){ if ( fh->f_rank == contg_groups[z].procs_in_contg_group[y] ) { fh->f_init_procs_per_group = contg_groups[z].procs_per_contg_group; + if (NULL != fh->f_init_procs_in_group) { + free(fh->f_init_procs_in_group); + } fh->f_init_procs_in_group = (int*)malloc (fh->f_init_procs_per_group * sizeof(int)); if (NULL == fh->f_init_procs_in_group) { opal_output (1, "OUT OF MEMORY\n"); From d5aa310884a9fea4487512ca7ecf702894515b2a Mon Sep 17 00:00:00 2001 From: Gilles Gouaillardet Date: Wed, 18 Jan 2017 16:33:23 +0900 Subject: [PATCH 06/12] mpiext/affinity: initialize all output variables of OMPI_Affinity_str() Signed-off-by: Gilles Gouaillardet --- ompi/mpiext/affinity/c/mpiext_affinity_str.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ompi/mpiext/affinity/c/mpiext_affinity_str.c b/ompi/mpiext/affinity/c/mpiext_affinity_str.c index 62fa0ccda6..bc6412da66 100644 --- a/ompi/mpiext/affinity/c/mpiext_affinity_str.c +++ b/ompi/mpiext/affinity/c/mpiext_affinity_str.c @@ -6,7 +6,7 @@ * Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2015 Research Organization for Information Science + * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2015 Intel, Inc. All rights reserved. * $COPYRIGHT$ @@ -59,6 +59,7 @@ int OMPI_Affinity_str(ompi_affinity_fmt_t fmt_type, memset(ompi_bound, 0, OMPI_AFFINITY_STRING_MAX); memset(current_binding, 0, OMPI_AFFINITY_STRING_MAX); + memset(exists, 0, OMPI_AFFINITY_STRING_MAX); /* If we have no hwloc support, return nothing */ if (NULL == opal_hwloc_topology) { From f4dc7e4134523a9168f096ecd2e39eae2e34887e Mon Sep 17 00:00:00 2001 From: Gilles Gouaillardet Date: Wed, 18 Jan 2017 10:02:55 +0900 Subject: [PATCH 07/12] orted/orted_submit: plug misc memory leaks - always invoke init_globals() before opal_cmd_line_parse(orte_cmd_line, ...) - plug more leaks in init_globals() - remove unused env_val and personalities fields from orte_cmd_options_t Signed-off-by: Gilles Gouaillardet --- orte/orted/orted_submit.c | 54 +++++++++++++++++++++++++++++++++------ orte/orted/orted_submit.h | 6 ++--- 2 files changed, 49 insertions(+), 11 deletions(-) diff --git a/orte/orted/orted_submit.c b/orte/orted/orted_submit.c index 238478c49c..2c29b90d14 100644 --- a/orte/orted/orted_submit.c +++ b/orte/orted/orted_submit.c @@ -706,10 +706,8 @@ int orte_submit_job(char *argv[], int *index, /* reset the globals every time thru as the argv * will modify them */ - if (NULL != orte_cmd_options.prefix) { - free(orte_cmd_options.prefix); - } - memset(&orte_cmd_options, 0, sizeof(orte_cmd_options)); + init_globals(); + argc = opal_argv_count(argv); /* parse the cmd line - do this every time thru so we can @@ -1099,20 +1097,60 @@ static int init_globals(void) orte_cmd_options.num_procs = 0; if (NULL != orte_cmd_options.appfile) { free(orte_cmd_options.appfile); + orte_cmd_options.appfile = NULL; } - orte_cmd_options.appfile = NULL; if (NULL != orte_cmd_options.wdir) { free(orte_cmd_options.wdir); + orte_cmd_options.wdir = NULL; } orte_cmd_options.set_cwd_to_session_dir = false; - orte_cmd_options.wdir = NULL; if (NULL != orte_cmd_options.path) { free(orte_cmd_options.path); + orte_cmd_options.path = NULL; + } + if (NULL != orte_cmd_options.hnp) { + free(orte_cmd_options.hnp); + orte_cmd_options.hnp = NULL; + } + if (NULL != orte_cmd_options.stdin_target) { + free(orte_cmd_options.stdin_target); + orte_cmd_options.stdin_target = NULL ; + } + if (NULL != orte_cmd_options.output_filename) { + free(orte_cmd_options.output_filename); + orte_cmd_options.output_filename = NULL ; + } + if (NULL != orte_cmd_options.binding_policy) { + free(orte_cmd_options.binding_policy); + orte_cmd_options.binding_policy = NULL; + } + if (NULL != orte_cmd_options.mapping_policy) { + free(orte_cmd_options.mapping_policy); + orte_cmd_options.mapping_policy = NULL; + } + if (NULL != orte_cmd_options.ranking_policy) { + free(orte_cmd_options.ranking_policy); + orte_cmd_options.ranking_policy = NULL; } - orte_cmd_options.path = NULL; + if (NULL != orte_cmd_options.report_pid) { + free(orte_cmd_options.report_pid); + orte_cmd_options.report_pid = NULL; + } + if (NULL != orte_cmd_options.report_uri) { + free(orte_cmd_options.report_uri); + orte_cmd_options.report_uri = NULL; + } + if (NULL != orte_cmd_options.slot_list) { + free(orte_cmd_options.slot_list); + orte_cmd_options.slot_list= NULL; + } orte_cmd_options.preload_binaries = false; - orte_cmd_options.preload_files = NULL; + if (NULL != orte_cmd_options.preload_files) { + free(orte_cmd_options.preload_files); + orte_cmd_options.preload_files = NULL; + } + /* All done */ return ORTE_SUCCESS; diff --git a/orte/orted/orted_submit.h b/orte/orted/orted_submit.h index 99c51072c3..b19ade0f53 100644 --- a/orte/orted/orted_submit.h +++ b/orte/orted/orted_submit.h @@ -1,6 +1,8 @@ /* * Copyright (c) 2015-2017 Intel, Inc. All rights reserved. - * Copyright (c) 2016 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2016 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2017 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -51,7 +53,6 @@ struct orte_cmd_options_t { bool terminate; bool debugger; int num_procs; - char *env_val; char *appfile; char *wdir; bool set_cwd_to_session_dir; @@ -69,7 +70,6 @@ struct orte_cmd_options_t { bool index_argv; bool run_as_root; char *personality; - char **personalities; bool create_dvm; bool terminate_dvm; bool nolocal; From 0f47310a75a35e82331a4efbbbcc6961ef2b1440 Mon Sep 17 00:00:00 2001 From: Gilles Gouaillardet Date: Mon, 23 Jan 2017 16:33:31 +0900 Subject: [PATCH 08/12] pmix2x/pmix2x_client: plug misc memory leaks Signed-off-by: Gilles Gouaillardet --- opal/mca/pmix/pmix2x/pmix2x_client.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/opal/mca/pmix/pmix2x/pmix2x_client.c b/opal/mca/pmix/pmix2x/pmix2x_client.c index bb3e891855..d758c8f6e3 100644 --- a/opal/mca/pmix/pmix2x/pmix2x_client.c +++ b/opal/mca/pmix/pmix2x/pmix2x_client.c @@ -585,6 +585,9 @@ int pmix2x_publish(opal_list_t *info) } ret = PMIx_Publish(pinfo, sz); + if (0 < sz) { + PMIX_INFO_FREE(pinfo, sz); + } return pmix2x_convert_rc(ret); } @@ -621,6 +624,9 @@ int pmix2x_publishnb(opal_list_t *info, } ret = PMIx_Publish_nb(op->info, op->sz, opcbfunc, op); + if (0 < op->sz) { + PMIX_INFO_FREE(op->info, op->sz); + } return pmix2x_convert_rc(ret); } @@ -931,6 +937,9 @@ int pmix2x_spawn(opal_list_t *job_info, opal_list_t *apps, opal_jobid_t *jobid) job->jobid = *jobid; opal_list_append(&mca_pmix_pmix2x_component.jobids, &job->super); } + if (0 < ninfo) { + PMIX_INFO_FREE(pinfo, ninfo); + } PMIX_APP_FREE(papps, napps); return pmix2x_convert_rc(ret); From b5b21043c4a25758aababc300f95a1e8ae7a060b Mon Sep 17 00:00:00 2001 From: Gilles Gouaillardet Date: Thu, 22 Dec 2016 13:09:42 +0900 Subject: [PATCH 09/12] pmix2x: plug a memory leak in _reg_nspace() Signed-off-by: Gilles Gouaillardet --- opal/mca/pmix/pmix2x/pmix2x_server_south.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/opal/mca/pmix/pmix2x/pmix2x_server_south.c b/opal/mca/pmix/pmix2x/pmix2x_server_south.c index 956844d9d5..e1195da202 100644 --- a/opal/mca/pmix/pmix2x/pmix2x_server_south.c +++ b/opal/mca/pmix/pmix2x/pmix2x_server_south.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2014-2017 Intel, Inc. All rights reserved. - * Copyright (c) 2014-2016 Research Organization for Information Science + * Copyright (c) 2014-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2014-2016 Intel, Inc. All rights reserved. * Copyright (c) 2014 Mellanox Technologies, Inc. @@ -242,6 +242,7 @@ static void _reg_nspace(int sd, short args, void *cbdata) pmix2x_value_load(&pmap[m].value, k2); ++m; } + OPAL_LIST_RELEASE(pmapinfo); } else { pmix2x_value_load(&pinfo[n].value, kv); } From acbc32d3b2f10de98e0e944b4e61c1a83fd8c4f6 Mon Sep 17 00:00:00 2001 From: Gilles Gouaillardet Date: Mon, 26 Dec 2016 17:28:56 +0900 Subject: [PATCH 10/12] pmix2x: plug a memory leak in opal_lkupcbfunc() Signed-off-by: Gilles Gouaillardet --- opal/mca/pmix/pmix2x/pmix2x_server_north.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/opal/mca/pmix/pmix2x/pmix2x_server_north.c b/opal/mca/pmix/pmix2x/pmix2x_server_north.c index 2d29e28bf8..c08cdf27ea 100644 --- a/opal/mca/pmix/pmix2x/pmix2x_server_north.c +++ b/opal/mca/pmix/pmix2x/pmix2x_server_north.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2014-2017 Intel, Inc. All rights reserved. - * Copyright (c) 2014-2016 Research Organization for Information Science + * Copyright (c) 2014-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2014-2015 Mellanox Technologies, Inc. * All rights reserved. @@ -433,6 +433,7 @@ static void opal_lkupcbfunc(int status, } } opalcaddy->lkupcbfunc(rc, d, nd, opalcaddy->cbdata); + PMIX_PDATA_FREE(d, nd); } OBJ_RELEASE(opalcaddy); } From 189da7fdabbfbe069480b6fef15aa97500acaf51 Mon Sep 17 00:00:00 2001 From: Gilles Gouaillardet Date: Fri, 6 Jan 2017 13:18:55 +0900 Subject: [PATCH 11/12] pmix2x: plug a memory leak in _event_hdlr() Signed-off-by: Gilles Gouaillardet --- opal/mca/pmix/pmix2x/pmix2x.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/opal/mca/pmix/pmix2x/pmix2x.c b/opal/mca/pmix/pmix2x/pmix2x.c index 6a08416d7c..10f6a5e772 100644 --- a/opal/mca/pmix/pmix2x/pmix2x.c +++ b/opal/mca/pmix/pmix2x/pmix2x.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2014-2017 Intel, Inc. All rights reserved. - * Copyright (c) 2014-2016 Research Organization for Information Science + * Copyright (c) 2014-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2014-2015 Mellanox Technologies, Inc. * All rights reserved. @@ -223,6 +223,8 @@ static void _event_hdlr(int sd, short args, void *cbdata) if (NULL != cd->pmixcbfunc) { cd->pmixcbfunc(PMIX_SUCCESS, NULL, 0, NULL, NULL, cd->cbdata); } + OPAL_LIST_RELEASE(cd->info); + OBJ_RELEASE(cd); return; } From d54e54538a8c180ef01c05751b05621954e61f5f Mon Sep 17 00:00:00 2001 From: Gilles Gouaillardet Date: Thu, 22 Dec 2016 13:12:00 +0900 Subject: [PATCH 12/12] orted/orted_submit: plug a memory leak Signed-off-by: Gilles Gouaillardet --- orte/orted/orted_submit.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/orte/orted/orted_submit.c b/orte/orted/orted_submit.c index 2c29b90d14..9343868a10 100644 --- a/orte/orted/orted_submit.c +++ b/orte/orted/orted_submit.c @@ -588,7 +588,7 @@ int orte_submit_init(int argc, char *argv[], void orte_submit_finalize(void) { trackr_t *trk; - int i; + int i, rc; for (i=0; i < tool_jobs.size; i++) { if (NULL != (trk = (trackr_t*)opal_pointer_array_get_item(&tool_jobs, i))) { @@ -597,6 +597,17 @@ void orte_submit_finalize(void) } OBJ_DESTRUCT(&tool_jobs); + /* close the SCHIZO framework */ + if (ORTE_SUCCESS != (rc = mca_base_framework_close(&orte_schizo_base_framework))) { + ORTE_ERROR_LOG(rc); + return; + } + + /* finalize only the util portion of OPAL */ + if (OPAL_SUCCESS != (rc = opal_finalize_util())) { + return; + } + /* destruct the cmd line object */ if (NULL != orte_cmd_line) { OBJ_RELEASE(orte_cmd_line); @@ -615,6 +626,12 @@ void orte_submit_finalize(void) if (NULL != orte_cmd_options.prefix) { free(orte_cmd_options.prefix); } + if (NULL != orte_launch_environ) { + opal_argv_free(orte_launch_environ); + } + if (NULL != orte_basename) { + free(orte_basename); + } } int orte_submit_cancel(int index) {