Re: OSX doesn't accept identical source/target for strcpy() anymore - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: OSX doesn't accept identical source/target for strcpy() anymore
Date
Msg-id 526ED3E0.1060006@gmx.net
Whole thread Raw
In response to Re: OSX doesn't accept identical source/target for strcpy() anymore  (Peter Geoghegan <pg@heroku.com>)
List pgsql-hackers
On 10/28/13, 4:11 PM, Peter Geoghegan wrote:
> On Mon, Oct 28, 2013 at 6:11 PM, Tom Lane <tgl@sss.pgh.pa.us> 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.




pgsql-hackers by date:

Previous
From: Asif Naeem
Date:
Subject: Re: PostgreSQL Service on Windows does not start. ~ "is not a valid Win32 application"
Next
From: Daniel Farina
Date:
Subject: What hook would you recommend for "one time, post authentication"?