(Should there be a libiberty category in GNATS?) I'm tracking down some bugs in which GDB consumes excessive memory. One of them is definitely foolishness in how ofter we call the demangler, but in fixing that I've discovered that the demangler itself leaks memory. Calling cplus_demangle with DMGL_ARM | DMGL_ANSI and this string, for example: _M_get_node__t19_Rb_tree_alloc_base3Zt4pair2ZCt12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b1i0Zt3map4Zt12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b1i0ZsZt4less1Zt12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b1i0Zt9allocator1ZsZt9allocator1Zt3map4Zt12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b1i0ZsZt4less1Zt12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b1i0Zt9allocator1Zsb1 leaks about 4K every time, above and beyond the malloc'd return value. Anyone have an idea why? Release: HEAD
From: drow@gcc.gnu.org To: gcc-gnats@gcc.gnu.org Cc: Subject: c++/7612 Date: 13 Feb 2003 17:21:20 -0000 CVSROOT: /cvs/gcc Module name: gcc Changes by: drow@gcc.gnu.org 2003-02-13 17:21:20 Modified files: libiberty : ChangeLog cplus-dem.c Log message: Fix PR c++/7612. * cplus-dem.c (demangle_signature): Call string_delete. Remove extra string_init. (demangle_arm_hp_template): Call string_delete instead of string_clear. Add missing string_delete call. (demangle_qualified): Add missing string_delete call. (do_type): Remove unused variable btype. Add missing string_delete call. Call string_delete instead of string_clear. (demangle_fund_type): Move variable btype inside of the switch statement. Add missing string_delete call. (do_arg): Call string_delete instead of string_clear. Remove extra string_init. (demangle_nested_args): Free work->previous_argument. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libiberty/ChangeLog.diff?cvsroot=gcc&r1=1.409&r2=1.410 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libiberty/cplus-dem.c.diff?cvsroot=gcc&r1=1.89&r2=1.90
State-Changed-From-To: open->feedback State-Changed-Why: A patch for this PR has been checked in in February. Is this fixed now? W.
Responsible-Changed-From-To: unassigned->drow Responsible-Changed-Why: Mine.
State-Changed-From-To: feedback->closed State-Changed-Why: Patch checked in, thanks for the prod.