Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Yao Qi <qiyaoltc@gmail.com>
To: Alex Lindsay <alexlindsay239@gmail.com>
Cc: gdb@sourceware.org
Subject: Re: Large memory usage by gdb
Date: Mon, 07 Aug 2017 09:16:00 -0000	[thread overview]
Message-ID: <86mv7b20z2.fsf@gmail.com> (raw)
In-Reply-To: <6f204cea-21bf-3f70-aa61-df02aeba8a24@gmail.com> (Alex Lindsay's	message of "Fri, 4 Aug 2017 16:43:23 -0500")

Alex Lindsay <alexlindsay239@gmail.com> writes:

> and new call-graph. So my question is, is what I'm doing valuable? I

Oh, definitely yes!  Thanks a lot for the investigation.

> haven't done any profiling yet to see how these changes affect my real
> use case where I'm debugging an executable with lots of shared
> libraries. Nevertheless, these leaks do seem to be very real. I know
> that GDB developers are way better programmers than I am, so the fact
> that these leaks haven't been found yet makes me wonder whether they
> matter in real use cases or not. I am using a gdb built from the git
> repository (GNU gdb (GDB) 8.0.50.20170803-git).

leaks are bugs, and we should fix them.  I can find these leaks in
valgrind too,

==21225== 463 (336 direct, 127 indirect) bytes in 1 blocks are definitely lost in loss record 10,770 of 10,949^M
==21225==    at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)^M
==21225==    by 0x6C6DA2: bfd_malloc (libbfd.c:193)^M
==21225==    by 0x6C6F4D: bfd_zmalloc (libbfd.c:278)^M
==21225==    by 0x6D252E: elf_x86_64_get_synthetic_symtab (elf64-x86-64.c:6846)^M
==21225==    by 0x4B397A: elf_read_minimal_symbols (elfread.c:1124)^M
==21225==    by 0x4B397A: elf_symfile_read(objfile*, enum_flags<symfile_add_flag>) (elfread.c:1182)^M
==21225==    by 0x63AC94: read_symbols(objfile*, enum_flags<symfile_add_flag>) (symfile.c:861)^M
==21225==    by 0x63A773: syms_from_objfile_1 (symfile.c:1062)

and

==21225== 32 bytes in 1 blocks are definitely lost in loss record 6,063 of 10,949^M
==21225==    at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)^M
==21225==    by 0x4C2FDEF: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)^M
==21225==    by 0x76CB31: d_growable_string_resize (cp-demangle.c:3963)^M
==21225==    by 0x76CB31: d_growable_string_init (cp-demangle.c:3942)^M
==21225==    by 0x76CB31: cplus_demangle_print (cp-demangle.c:4308)^M
==21225==    by 0x4C9535: cp_comp_to_string(demangle_component*, int) (cp-name-parser.y:1972)^M
==21225==    by 0x53EF14: cp_canonicalize_string[abi:cxx11](char const*) (cp-support.c:569)^M
==21225==    by 0x561B75: dwarf2_canonicalize_name(char const*, dwarf2_cu*, obstack*) [clone .isra.210] (dwarf2read.c:20159)^M
==21225==    by 0x566B77: read_partial_die (dwarf2read.c:16264)

Can you post your two patches 
https://github.com/lindsayad/gdb/pull/1/files separately to
gdb-patches@sourceware.org?

-- 
Yao (齐尧)


  reply	other threads:[~2017-08-07  9:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-25 20:20 Alex Lindsay
2017-07-25 20:28 ` Philippe Waroquiers
2017-07-31 22:11   ` Alex Lindsay
2017-08-01 19:12     ` Philippe Waroquiers
     [not found]       ` <420b109c-1610-d687-ae9a-b172542fafca@gmail.com>
2017-08-04 21:43         ` Alex Lindsay
2017-08-07  9:16           ` Yao Qi [this message]
2017-08-07 19:53             ` Philippe Waroquiers
2017-08-07 21:04               ` Alex Lindsay
2017-08-07 21:34                 ` Simon Marchi
2017-08-07 18:19         ` Philippe Waroquiers
2017-07-26  7:28 ` Yao Qi
     [not found]   ` <4fc14853-b066-4fd7-f0c9-b98f442a9a95@gmail.com>
2017-07-26 15:55     ` Yao Qi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86mv7b20z2.fsf@gmail.com \
    --to=qiyaoltc@gmail.com \
    --cc=alexlindsay239@gmail.com \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox