pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@2ndquadrant.com>
To: pgsql-hackers@postgresql.org
To: Matthias Schmitt <freak002@mmp.lu>
Subject: OSX doesn't accept identical source/target for strcpy() anymore
Date: Mon, 28 Oct 2013 17:11:32 +0100
Message-ID: <20131028161132.GA14980@awork2.anarazel.de> (raw)
In-Reply-To: <934199A3-FF2F-4E5E-A8FF-E6F621B6F64D@mmp.lu>
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>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Hi,

On -bugs it was reported that initdb of 9.3 failed with a
assertion.

On 2013-10-28 16:52:13 +0100, Matthias Schmitt wrote:
> > In that case, could you enable coredumps and get a backtrace from that
> > coredump? I unfortunately have zero clue about OSX, so I can't really
> > help you with that.
> 
> Yes, you are right. I totally forgot about the crash logs in OS X. Here it is:

Ah, ok. I see the problem...

> Process:         postgres [68949]
> Path:            /Users/*/postgres
> Identifier:      postgres
> Version:         0
> Code Type:       X86-64 (Native)
> Parent Process:  sh [68948]
> Responsible:     Terminal [411]
> User ID:         502
> 
> Date/Time:       2013-10-28 16:46:28.188 +0100
> OS Version:      Mac OS X 10.9 (13A603)

> Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
> 0   libsystem_kernel.dylib        	0x00007fff93e00866 __pthread_kill + 10
> 1   libsystem_pthread.dylib       	0x00007fff92c7335c pthread_kill + 92
> 2   libsystem_c.dylib             	0x00007fff8c5a5bba abort + 125
> 3   libsystem_c.dylib             	0x00007fff8c5a5d31 abort_report_np + 181
> 4   libsystem_c.dylib             	0x00007fff8c5c98c5 __chk_fail + 48
> 5   libsystem_c.dylib             	0x00007fff8c5c98d5 __chk_fail_overlap + 16
> 6   libsystem_c.dylib             	0x00007fff8c5c9906 __chk_overlap + 49
> 7   libsystem_c.dylib             	0x00007fff8c5c9a59 __strncpy_chk + 78
> 8   postgres                      	0x000000010b4c9045 namestrcpy + 86
> 9   postgres                          0x000000010b1901f2 TupleDescInitEntry + 99

It seems the newest version of OSX is more strict about strcpy than
previous ones. So the issue is likely the upgraded OS version. Which
means we're going to see this more frequently now.

There have been previous discussions about fixing strcpy calls with
identical source/destination (same for memcpy) but it was deemed not
worth the effort. I don't really see an alternative to fixing it now.

Greetings,

Andres Freund

-- 
 Andres Freund	                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (22+ messages)  latest in thread

Message-ID: <20131028161132.GA14980@awork2.anarazel.de>
Permalink:  ../20131028161132.GA14980@awork2.anarazel.de/
Also on:    postgresql.org/message-id/20131028161132.GA14980@awork2.anarazel.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: andres@2ndquadrant.com, pgsql-hackers@postgresql.org, freak002@mmp.lu
  Subject: Re: OSX doesn't accept identical source/target for strcpy() anymore
  In-Reply-To: <20131028161132.GA14980@awork2.anarazel.de>
  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>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox