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] gdbserver: Fix overlapping memcpy (safe now)


On Friday 02 December 2011 21:44:28, Jan Kratochvil wrote:
> Hi,
> 
> I thought it is causing a crash but that was a different cause.  Anyway
> I already had the patch, it violates ISO C memcpy definition
> 	If copying takes place between objects that overlap, the behavior is
> 	undefined.
> and it also complains in valgrind:
> 	Source and destination overlap in memcpy(0x4c81da8, 0x4c81da8, 1)
> 	   at: memcpy@@GLIBC_2.14 (mc_replace_strmem.c:653)
> 	   by: check_mem_write (mem-break.c:1102)
> 	   by: write_inferior_memory (target.c:66)
> 	   by: uninsert_raw_breakpoint (mem-break.c:751)
> 	   by: uninsert_breakpoints_at (mem-break.c:784)
> 
> I find too fragile to pass a pointer into internal buffer into a set of
> functions modifying that buffer.
> 
> No regressions on {x86_64,x86_64-m32,i686}-fedora16-linux-gnu gdbserver mode.
> 
> I will check it in without comments, I find it safe.

Fine with me.  Thanks.

-- 
Pedro Alves


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