Re: overlapping strncpy/memcpy errors via valgrind - Mailing list pgsql-hackers

From Andres Freund
Subject Re: overlapping strncpy/memcpy errors via valgrind
Date
Msg-id 20130217151937.GB5073@awork2.anarazel.de
Whole thread Raw
In response to Re: overlapping strncpy/memcpy errors via valgrind  (Greg Stark <stark@mit.edu>)
Responses Re: overlapping strncpy/memcpy errors via valgrind  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 2013-02-17 15:10:35 +0000, Greg Stark wrote:
> Peter G is sitting near me and reminded me that this issue came up in the
> past. Iirc the conclusion then is that we're calling memcpy where the
> source and destination pointers are sometimes identical. Tom decided there
> was really no realistic architecture where that wouldn't work. 

I am not so convinced that that is safe if libc turns that into some
optimized string instructions or even PCMPSTR...

> We're not calling it on overlapping nonidentical pointers.

Yup, the backtrace shows that...

Greetings,

Andres Freund

-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services



pgsql-hackers by date:

Previous
From: Phil Sorber
Date:
Subject: Re: [PATCH] Add PQconninfoParseParams and PQconninfodefaultsMerge to libpq
Next
From: Tom Lane
Date:
Subject: Re: overlapping strncpy/memcpy errors via valgrind