[PATCH] gdb/record-full: Use xmalloc instead of alloca for large buffers.
Ulrich Weigand
uweigand@de.ibm.com
Tue Nov 3 17:31:00 GMT 2015
Marcin KoÃÂ
cielnicki <koriakin at 0x04 dot net> wrote:
> On the newly added s390 target, it's possible for a single instruction
> to write practically unbounded amount of memory (eg. MVCLE). This caused
> a stack overflow when alloca was used.
>
> gdb/ChangeLog:
>
> * record-full.c (record_full_exec_insn): Use xmalloc for large buffers.
I think this may leak memory if some code between the xmalloc and the xfree
throws a GDB exception. Usually, this is protected against by calling the
xfree via the make_cleanup mechanism ...
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU/Linux compilers and toolchain
Ulrich.Weigand@de.ibm.com
More information about the Gdb-patches
mailing list