[dm-devel] Re: Memory leak in multipathd.

christophe.varoqui at free.fr christophe.varoqui at free.fr
Tue May 12 21:05:08 UTC 2009


Ok, to my knowledge Konrad plugged this one in December upstream :

commit d0d98bc348b69d873841b10dd9a1c73af305f0fd
Author: Konrad Rzeszutek <konrad at virtualiron.com>
Date:   Wed Dec 17 23:19:19 2008 +0100

Thank you for the report Hari. But know that there are very few tarball releases, so upstream is really the git HEAD. This is what you should check and see if the bugs you report are already fixed.

Best regards,
cvaroqui

----- Mail Original -----
De: "Harikrishnan Padidakul" <hpadidakul at inmage.net>
À: "christophe varoqui" <christophe.varoqui at free.fr>
Cc: dm-devel at redhat.com
Envoyé: Mardi 12 Mai 2009 07h42:36 GMT +01:00 Amsterdam / Berlin / Berne / Rome / Stockholm / Vienne
Objet: RE: Memory leak in multipathd.



I am reporting memory leak for the code multipath-tools-0.4.7.rhel5.13 downloaded from rhel and multipath-tools-0.4.8. 
vector_free() will not free the mpp's allocated by dm_get_maps(). Here we need to call free_multipath() 
Below is by fix: 

dm_get_name(char *uuid, char *type, char *name) 
{ 
vector vec; 
struct multipath *mpp; 
int ret; 
int i; 
vec = vector_alloc(); 
if (!vec) 
return 0; 
if (dm_get_maps(vec, type)) { 
vector_free(vec); 
return 0; 
} 
vector_foreach_slot(vec, mpp, i) { 
if (!strcmp(uuid, mpp->wwid)) { 
strcpy(name, mpp->alias); 
ret = 1; 
goto found; 
} 
} 
ret = 0; 
found: 
vector_foreach_slot(vec, mpp, i) { 
free_multipath(mpp, KEEP_PATHS); 
} 
vector_free(vec); 
return ret; 
} 

Thanks, 
Hari 





From: christophe.varoqui at free.fr [mailto:christophe.varoqui at free.fr] 
Sent: Tue 5/12/2009 3:13 AM 
To: Harikrishnan Padidakul 
Cc: dm-devel at redhat.com 
Subject: Re: Memory leak in multipathd. 




> I was testing multipath with more than 3000paths, I found multipathd using around 2.3GB of memory. 
> After closely digging the code, I found In function dm_get_name() we are calling dm_get_maps() which will allocate memory for mmp. 
> But we are not freeing the same after search is done. 
> I have made a fix by calling free_multipath() ,w ith this fix multipathd is using less than 200MB of memory. 

Hi Hari, 

are you reporting on the upstream multipath-tools code ? I already see multipath vector freeing there ... 




More information about the dm-devel mailing list