Re: OS X 10.11.3, psql, bus error 10, 9.5.1

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Chris Ruprecht <chris(at)cdrbill(dot)com>
Cc: GENERAL <pgsql-general(at)postgresql(dot)org>
Subject: Re: OS X 10.11.3, psql, bus error 10, 9.5.1
Date: 2016-03-12 22:34:48
Message-ID: 5032.1457822088@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Chris Ruprecht <chris(at)cdrbill(dot)com> writes:
> no such luck (no easy fix). I turned SIP off and rebuilt PG 9.5.1, copied libpq.5.8.dylib to /usr/lib, bent the two sym links to the new library but I'm still getting "Bus error: 10". You owe somebody a nickel, Tom ;).

Oh well.

Personally I'd not have messed with the contents of /usr/lib; you risk
breaking programs that expect that to be platform-standard. (In theory
current libpq should be upward-compatible with a couple releases back;
but that assumes you built with the same options as Apple did, which is
a rather large assumption, especially in view of the following.)

> My configure script looks like this (and this works for building PG 9.4.4 on the same machine with SIP enabled):

> export CC=cc
> export CPP="cc -E"
> export CXX=c++
> export CXXFLAGS='-O3 -fno-common -arch x86_64'
> export CFLAGS='-O3 -fno-common -arch x86_64 -I/usr/local/include'
> export LDFLAGS='-O3 -fno-common -arch x86_64 -L/usr/local/lib'

Hmm, dunno about those CFLAGS/LDFLAGS settings. When I use those,
I get bus errors too. [ experiments... ] Apparently -fno-common
is the culprit. I don't know what that does, and the clang man
page isn't terribly helpful:

-fcommon
This flag specifies that variables without initializers get common
linkage. It can be disabled with -fno-common.

That's confusing because it implies that -fno-common is the default,
which it evidently is not. But anyway, my diagnosis is that you're
breaking something about the linker's behavior with that switch.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2016-03-12 22:58:11 Re: [GENERAL] OS X 10.11.3, psql, bus error 10, 9.5.1
Previous Message Karsten Hilbert 2016-03-12 22:13:59 Re: Q: extract database name from directory dump

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2016-03-12 22:43:44 Re: Refactoring speculative insertion with unique indexes a little
Previous Message Peter Geoghegan 2016-03-12 22:24:37 Re: Refactoring speculative insertion with unique indexes a little