Open MPI logo

Open MPI Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Development mailing list

Subject: Re: [OMPI devel] mca_bml_r2_del_btl incorrect memory size reallocation?
From: Jeff Squyres (jsquyres) (jsquyres_at_[hidden])
Date: 2014-01-23 13:12:30


This function is generally called during MPI_Finalize (i.e., when everything is being torn down).

It may also be called during the disconnection of MPI dynamic processes (i.e., we don't need a BTL connection to a given peer anymore because the last communicator containing it has been released).

On Jan 23, 2014, at 3:57 AM, Christoph Niethammer <niethammer_at_[hidden]> wrote:

> Hello
>
> I think I found a minor memory bug in the bml_r2 code in function mca_bml_r2_del_btl but I could not figure out when this function ever gets called.
> How can I test this function in a proper way?
>
> Here the diff showing the issue:
>
> @@ -699,11 +699,11 @@ static int mca_bml_r2_del_btl(mca_btl_base_module_t* btl)
> if(!found) {
> /* doesn't even exist */
> goto CLEANUP;
> }
> /* remove from bml list */
> - modules = (mca_btl_base_module_t**)malloc(sizeof(mca_btl_base_module_t*) * mca_bml_r2.num_btl_modules-1);
> + modules = (mca_btl_base_module_t**)malloc(sizeof(mca_btl_base_module_t*) * (mca_bml_r2.num_btl_modules-1));
> for(i=0,m=0; i<mca_bml_r2.num_btl_modules; i++) {
> if(mca_bml_r2.btl_modules[i] != btl) {
> modules[m++] = mca_bml_r2.btl_modules[i];
> }
> }
>
>
> Regards
> Christoph
>
> --
>
> Christoph Niethammer
> High Performance Computing Center Stuttgart (HLRS)
> Nobelstrasse 19
> 70569 Stuttgart
>
> Tel: ++49(0)711-685-87203
> email: niethammer_at_[hidden]
> http://www.hlrs.de/people/niethammer
> _______________________________________________
> devel mailing list
> devel_at_[hidden]
> http://www.open-mpi.org/mailman/listinfo.cgi/devel

-- 
Jeff Squyres
jsquyres_at_[hidden]
For corporate legal information go to: http://www.cisco.com/web/about/doing_business/legal/cri/