From: matt rice <ratmice@gmail.com>
To: gdb-patches@sourceware.org
Cc: matt rice <ratmice@gmail.com>
Subject: [PATCH] issues in bcache_xmalloc calls.
Date: Fri, 26 Aug 2011 09:23:00 -0000 [thread overview]
Message-ID: <1314350550-15312-1-git-send-email-ratmice@gmail.com> (raw)
While doing the macro patches, I noticed these 2 things,
though i have not tried it solib-sunos.c seems as though it should not compile
for almost a year, I didn't see a bug report or email so I'm going to go out on
a limb and say its relatively unused.
earlier in reread_symbols the bcaches are allocated, and it looks like a leak
to me... don't see any way to cause it to free in the inbetween. Just in case,
i set these up as uninitialized values and ran the testsuite to make sure.
it was covered by gdb.base/reread.exp.
2011-08-26 Matt Rice <ratmice@gmail.com>
* solib-sunos.c (allocate_rt_common_objfile): Add missing arguments to
bcache_xmalloc.
* symfile.c (reread_symbols): Remove extra calls to bcache_xmalloc.
---
gdb/solib-sunos.c | 6 +++---
gdb/symfile.c | 3 ---
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/gdb/solib-sunos.c b/gdb/solib-sunos.c
index 405ca4f..5bf765d 100644
--- a/gdb/solib-sunos.c
+++ b/gdb/solib-sunos.c
@@ -189,9 +189,9 @@ allocate_rt_common_objfile (void)
objfile = (struct objfile *) xmalloc (sizeof (struct objfile));
memset (objfile, 0, sizeof (struct objfile));
- objfile->psymbol_cache = bcache_xmalloc ();
- objfile->macro_cache = bcache_xmalloc ();
- objfile->filename_cache = bcache_xmalloc ();
+ objfile->psymbol_cache = bcache_xmalloc (NULL, NULL);
+ objfile->macro_cache = bcache_xmalloc (NULL, NULL);
+ objfile->filename_cache = bcache_xmalloc (NULL, NULL);
obstack_init (&objfile->objfile_obstack);
objfile->name = xstrdup ("rt_common");
diff --git a/gdb/symfile.c b/gdb/symfile.c
index aca907a..bb233c9 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -2472,9 +2472,6 @@ reread_symbols (void)
memset (&objfile->msymbol_demangled_hash, 0,
sizeof (objfile->msymbol_demangled_hash));
- objfile->psymbol_cache = psymbol_bcache_init ();
- objfile->macro_cache = bcache_xmalloc (NULL, NULL);
- objfile->filename_cache = bcache_xmalloc (NULL, NULL);
/* obstack_init also initializes the obstack so it is
empty. We could use obstack_specify_allocation but
gdb_obstack.h specifies the alloc/dealloc
--
1.7.4.4
next reply other threads:[~2011-08-26 9:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-26 9:23 matt rice [this message]
2011-08-26 12:06 ` Pedro Alves
2011-08-26 16:56 ` Tom Tromey
2011-08-27 10:38 ` Matt Rice
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=1314350550-15312-1-git-send-email-ratmice@gmail.com \
--to=ratmice@gmail.com \
--cc=gdb-patches@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