Re: overlapping strncpy/memcpy errors via valgrind

Поиск
Список
Период
Сортировка
От anarazel@anarazel.de
Тема Re: overlapping strncpy/memcpy errors via valgrind
Дата
Msg-id 3f051456-b28a-4dd1-9044-65c7feda392c@email.android.com
обсуждение исходный текст
Ответ на Re: overlapping strncpy/memcpy errors via valgrind  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers

Tom Lane <tgl@sss.pgh.pa.us> schrieb:

>Andres Freund <andres@2ndquadrant.com> writes:
>> 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...
>
>What would you envision happening that would be bad?

Afair some of the optimized instructions (like movdqa) don't necessarily work if source an target are in the same
location.Not sure about it bit I wouldn't want to depend on it. 

Andres


---
Please excuse brevity and formatting - I am writing this on my mobile phone.



В списке pgsql-hackers по дате отправления:

Предыдущее
От: "David E. Wheeler"
Дата:
Сообщение: Re: JSON Function Bike Shedding
Следующее
От: "anarazel@anarazel.de"
Дата:
Сообщение: Re: overlapping strncpy/memcpy errors via valgrind