Re: overlapping strncpy/memcpy errors via valgrind

From: "anarazel(at)anarazel(dot)de" <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>,Boszormenyi Zoltan <zb(at)cybertec(dot)at>
Cc: Andres Freund <andres(at)2ndquadrant(dot)com>, Greg Stark <stark(at)mit(dot)edu>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: overlapping strncpy/memcpy errors via valgrind
Date: 2013-02-17 18:52:46
Message-ID: da54cd4c-4cb9-46f8-950c-ce6efffbc918@email.android.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> schrieb:

>Boszormenyi Zoltan <zb(at)cybertec(dot)at> writes:
>> Then, why isn't memcpy() skipped if the source and dest are the same?
>> It would be a micro-optimization but a valid one.
>
>No, it'd be more like a micro-pessimization, because the test would be
>wasted effort in the vast majority of calls. The *only* reason to do
>this would be to shut up valgrind, and that seems annoying.
>
>I wonder if anyone's tried filing a bug against valgrind to say that it
>shouldn't complain about this case.

You already need a suppression file to use valgrind sensibly, its easy enough to add it there. Perhaps we should add one to the tree?

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2013-02-17 19:31:44 Re: overlapping strncpy/memcpy errors via valgrind
Previous Message anarazel@anarazel.de 2013-02-17 18:48:53 Re: overlapping strncpy/memcpy errors via valgrind