This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA/HPUX] somread.c: avoid stack overflow
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: brobecker at adacore dot com
- Cc: gdb-patches at sources dot redhat dot com
- Date: Wed, 4 Oct 2006 21:32:11 +0200 (CEST)
- Subject: Re: [RFA/HPUX] somread.c: avoid stack overflow
- References: <20061004182505.GH23247@adacore.com>
> Date: Wed, 4 Oct 2006 11:25:05 -0700
> From: Joel Brobecker <brobecker@adacore.com>
>
> Hello,
>
> A customer of ours ran into a GDB crash that was caused by a stack
> overflow. Their executables are very large, and it turned out when
> we started debugging that the overflow happened during an alloca
> besides which there already was a FIXME:.
>
> We replace the calls to alloca by a call to xmalloc followed by
> make_cleanup and the problem was gone.
>
> 2006-10-04 Joel Brobecker <brobecker@adacore.com>
>
> * somread.c (som_symtab_read): Avoid using alloca for potentially
> large buffers.
>
> Tested on pa-hpux, no regression.
>
> OK to commit?
Looks reasonable to me.