This is the mail archive of the
mailing list for the GDB project.
Re: [patch] Fix for excessive stack use (gdb/10457)
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Paul Pluzhnikov <ppluzhnikov at google dot com>
- Cc: gdb-patches ml <gdb-patches at sourceware dot org>, Holger Freyther <zecke at selfish dot org>
- Date: Thu, 8 Oct 2009 09:20:40 -0700
- Subject: Re: [patch] Fix for excessive stack use (gdb/10457)
- References: <email@example.com>
> 2009-10-07 Paul Pluzhnikov <firstname.lastname@example.org>
> * elfread.c (elf_symtab_read): Don't use alloca in a loop.
alloca was very convenient because it allows us to not worry about
memory leaks that could happen if record_minimal_symbol throws an error,
for instance. Thanks to Jan's excellent eyes, we know that
record_minimal_symbol eventually results in a call to XCALLOC, which
can possibly cause an internal_error(). It's very unlikely to happen.
So I wouldn't have complained if you had used a cleanup to make sure
that the memory is always released. But in this case, I don't see
record_minimal_symbol ever needing to thrown an exception on its own,
and I don't see that such a small leak can make a difference if we run
out of memory.
The patch is approved.