[Mono-dev] [PATCH] Memory leak in debug support code

Martin Baulig martin at ximian.com
Tue Jun 10 09:34:09 EDT 2008


Hi Rodrigo,

patch looks good, please commit.

Martin

On Mon, 2008-06-09 at 17:16 -0300, Rodrigo Kumpera wrote:
> Hi Martin,
> 
> The attached patch fixes two memory leaks related to how
> mono-debug.c::find_method works.
> 
> The patch moves mono_debug_free_method_jit_info from mini/debug-mini.c
> to metadata/mono-debug.c and
> add it to the public API.
> 
> The first memleak happens from ves_icall_System_Exception_get_trace
> which leaks memory every time
> source/line info is extracted from debug info. The second happens
> debug-mini.c::mono_debug_print_vars when it
> call mono_debug_find_method.
> 
> The issue is that find_method returns a new malloc'ed struct and no
> code took care of free'ing that.
> 
> Please review. I think this fix is very important to get into 2.0 as,
> for example, we leak 125k on 2.0 System test suite just
> due to the get_trace leaks.
> 
> Thanks,
> Rodrigo
-- 
Martin Baulig - martin at novell.com
Novell GmbH, Düsseldorf
GF: Volker Smid, Djamel Souici; HRB 21108 (AG Düsseldorf)




More information about the Mono-devel-list mailing list