This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++/7612: Memory leaks in cplus-dem.c


>Number:         7612
>Category:       c++
>Synopsis:       Memory leaks in cplus-dem.c
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Aug 16 06:06:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     drow@mvista.com
>Release:        HEAD
>Organization:
>Environment:

>Description:
(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?
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]