Re: OSX doesn't accept identical source/target for strcpy() anymore

From: didier <did447(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Andres Freund <andres(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Matthias Schmitt <freak002(at)mmp(dot)lu>
Subject: Re: OSX doesn't accept identical source/target for strcpy() anymore
Date: 2013-10-28 18:44:12
Message-ID: CAJRYxuLj=usQC5FtnVeYMPjSZt2n5T9NOi4Hj-LMtPnVWdA1JQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

Hi,

On Mon, Oct 28, 2013 at 7:11 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

>
> If copying takes place between objects that overlap, the behavior is
> undefined.
>
> Both gcc and glibc have been moving steadily in the direction of
> aggressively exploiting "undefined behavior" cases for optimization
> purposes. I don't know if there is yet a platform where strncpy with
> src == dest behaves oddly, but we'd be foolish to imagine that it's
> not going to happen eventually. If anything, Apple is probably doing
> us a service by making it obvious where we're failing to adhere to spec.
>
> However ... I still can't replicate this here, and as you say, there's
> about zero chance of keeping our code clean of this problem unless we
> can set up a buildfarm member that will catch it.
>
> regards, tom lane
>
>
I haven't a 10.9 box for double checking but there's a gcc command line
triggering the same assert for strcpy and gcc at
http://lists.gnu.org/archive/html/bug-bash/2013-07/msg00011.html.

Didier

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Andrew Dunstan 2013-10-28 19:20:20 Re: OSX doesn't accept identical source/target for strcpy() anymore
Previous Message Andres Freund 2013-10-28 18:26:53 Re: OSX doesn't accept identical source/target for strcpy() anymore

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2013-10-28 19:02:41 Re: better atomics
Previous Message Andres Freund 2013-10-28 18:26:53 Re: OSX doesn't accept identical source/target for strcpy() anymore