Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Vau9n-0003ie-VX for pgsql-hackers@arkaria.postgresql.org; Mon, 28 Oct 2013 21:15:28 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Vau9n-0006K5-BE for pgsql-hackers@arkaria.postgresql.org; Mon, 28 Oct 2013 21:15:27 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Vau9m-0006Jv-33 for pgsql-hackers@postgresql.org; Mon, 28 Oct 2013 21:15:26 +0000 Received: from eisentraut.org ([85.214.91.16] helo=gattler.pezone.net) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Vau9f-0001Il-7A for pgsql-hackers@postgresql.org; Mon, 28 Oct 2013 21:15:25 +0000 Received: from jesse.mybdev.com (unknown [204.145.120.11]) by gattler.pezone.net (Postfix) with ESMTPSA id D0FD459000F; Mon, 28 Oct 2013 21:15:14 +0000 (UTC) Message-ID: <526ED3E0.1060006@gmx.net> Date: Mon, 28 Oct 2013 17:15:12 -0400 From: Peter Eisentraut User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 MIME-Version: 1.0 To: Peter Geoghegan , Tom Lane CC: Robert Haas , Andres Freund , "pgsql-hackers@postgresql.org" , Matthias Schmitt Subject: Re: OSX doesn't accept identical source/target for strcpy() anymore References: <5A871654-B250-4837-99DB-EB6D44E64E65@mmp.lu> <20131028144225.GG5577@awork2.anarazel.de> <55D64809-F305-41A9-946B-8EAFF88FBE3B@mmp.lu> <20131028153750.GH5577@awork2.anarazel.de> <934199A3-FF2F-4E5E-A8FF-E6F621B6F64D@mmp.lu> <20131028161132.GA14980@awork2.anarazel.de> <7718.1382983872@sss.pgh.pa.us> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 10/28/13, 4:11 PM, Peter Geoghegan wrote: > On Mon, Oct 28, 2013 at 6:11 PM, Tom Lane wrote: >> 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. > > It's worth being aware of the fact that the upcoming GCC 4.9 release > is expected to ship with an "Undefined Behavior Sanitizer", as > described here: > > http://gcc.gnu.org/gcc-4.9/changes.html Address Sanitizer, which is already in clang and gcc, does catch the case were are talking about (as was previously discussed). But its only reaction is crashing, and in my testing it's crashing already before it gets to this place, so we'd have to put in some more work before it will be useful. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers