[PATCH] Fix segfault on empty else

Andrew STUBBS andrew.stubbs@st.com
Wed Jun 21 10:50:00 GMT 2006


Daniel Jacobowitz wrote:
> On Tue, Jun 20, 2006 at 03:33:37PM +0100, Andrew STUBBS wrote:
>> 2006-06-20  Andrew Stubbs  <andrew.stubbs@st.com>
>>
>>         * cli/cli-script.c (realloc_body_list): Zero new parts of body_list.
> 
> OK, thanks!

Thanks, committed.

> Want to add a corresponding test?  Though it likely wouldn't crash,
> unless you tried running the testsuite under valgrind.

How about the attached? It is somewhat tricky trying to reliably 
reproduce the problem without valgrind, as you say.

I have put in a few commands that are intended to run through the same 
code and will, most likely, allocate memory in the same place, in order 
to ensure that the crash occurs. This is a little hopeful, but what else 
can I do?

This works for me, but could you please confirm that it works in your 
setup/host (without the patch to fix the problem of course).

Thanks

Andrew
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: empty-else-test.patch
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20060621/b5899dd3/attachment.ksh>


More information about the Gdb-patches mailing list