Open MPI logo

Open MPI Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Development mailing list

Subject: [OMPI devel] RFC: fix various leaks in trunk (touches coll/ml, vprotocol, pml/v, btl/openib, and mca/base)
From: Nathan Hjelm (hjelmn_at_[hidden])
Date: 2012-11-05 18:31:05


What: I used valgrind on ompi_info and found several leaks in the trunk. This patch fixes some of the leaks.

pml/v:
  - If vprotocol is not being used vprotocol_include_list is leaked. Assume vprotocol never takes ownership (see below) and always free the string.

coll/ml:
  - (patch verified) calling mca_base_param_lookup_string after mca_base_param_reg_string is unnecessary. The call to mca_base_param_lookup_string causes the value returned by mca_base_param_reg_string to be leaked.
  - Need to free mca_coll_ml_component.config_file_name on component close.

btl/openib:
  - calling mca_base_param_lookup_string after mca_base_param_reg_string is unnecessary. The call to mca_base_param_lookup_string causes the value returned by mca_base_param_reg_string to be leaked.

vprotocol/base:
  - There was no way for pml/v to determine if vprotocol took ownership of vprotocol_include_list. Fix by always never ownership (use strdup).

mca/base:
  - param_lookup will result in storage->stringval to be a newly allocated string if the mca parameter has a string value. ensure this string is always freed.

When: This is a simple patch. Timeout set for tomorrow @ 12:00 PM MST

Why: Always a good idea to clean up all allocated memory. With this patch and some others I have in the pipeline valgrind no longer reports and "possibly leaked" or "definitely leaked" blocks in ompi_info.

-Nathan Hjelm
HPC-3, LANL