This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] gdb/record-full: Use xmalloc instead of alloca for large buffers.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]