Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Postgresl 9.1.3 - PSQL crashing when querying #10979

Closed
peter-svensson opened this issue Mar 16, 2012 · 13 comments
Closed

Postgresl 9.1.3 - PSQL crashing when querying #10979

peter-svensson opened this issue Mar 16, 2012 · 13 comments

Comments

@peter-svensson
Copy link

Installed postgres 9.1.3 with: brew install postgis.
Created an initial database and then tried to access it with psql (pgadmin queries working just fine).

PSQL crashes with segmentation fault every time I try to ask a query.
Inserting data seems to be working just fine. Hooked up the debugger and I get:

gdb --args /usr/local/Cellar/postgresql/9.1.3/bin/psql -U postgres

postgres=# select * from pg_tables;

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: 13 at address: 0x0000000000000000
0x0000000100005b0f in SendQuery ()
(gdb) bt
#0  0x0000000100005b0f in SendQuery ()
#1  0x00000001000087a4 in MainLoop ()
#2  0x000000010000cc2c in main ()

Looks like a NULL reference?

Installed Postgresl from the official builds from postgresl site and it worked just fine.

@Sharpie
Copy link
Contributor

Sharpie commented Mar 16, 2012

Please post the output of brew --config. We need to know basic details like which version of OS X and Xcode you are using.

Also, run brew doctor and let us know if it notes any potential problems.

@peter-svensson
Copy link
Author

 brew --config

HOMEBREW_VERSION: 0.8.1
HEAD: 1c2789c93479e322a73bf121689b72f56f11aa62
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
Hardware: 8-core 64-bit sandybridge
OS X: 10.7.3
Kernel Architecture: x86_64
Xcode: 4.3.1
GCC-4.0: N/A
GCC-4.2: build 5666
LLVM: build 2336
Clang: 3.0 build 211
MacPorts or Fink? false
X11: /usr/X11
System Ruby: 1.8.7-249
/usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
Which Perl: /usr/bin/perl
Which Python: /usr/local/bin/python => /usr/local/Cellar/python/2.7.2/bin/python
Which Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby

brew doctor

Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected dylibs:
/usr/local/lib/libfreetype.6.dylib /usr/local/lib/libmacfuse_i32.2.dylib /usr/local/lib/libmacfuse_i64.2.dylib /usr/local/lib/libosxfuse_i32.2.dylib /usr/local/lib/libosxfuse_i64.2.dylib

Warning: Unbrewed .la files were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .la files:
/usr/local/lib/libfreetype.la /usr/local/lib/libosxfuse_i32.la /usr/local/lib/libosxfuse_i64.la

Warning: Unbrewed .pc files were found in /usr/local/lib/pkgconfig.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .pc files:
/usr/local/lib/pkgconfig/freetype2.pc /usr/local/lib/pkgconfig/osxfuse.pc

Warning: Unbrewed static libraries were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected static libraries:
/usr/local/lib/libfreetype.a

Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built.

libiconv

Warning: Homebrew's sbin was not found in your path.
Consider ammending your PATH variable so it contains:
/usr/local/sbin

@davidglassborow
Copy link

I'm seeing the same issue, a simple 'psql -l' will segfault

~→ brew --config
HOMEBREW_VERSION: 0.9
HEAD: ad5814b
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: 8-core 64-bit sandybridge
OS X: 10.7.3
Kernel Architecture: x86_64
Xcode: 4.3
GCC-4.0: N/A
GCC-4.2: N/A
LLVM: build 2336
Clang: 3.0 build 211
MacPorts or Fink? false
X11: /usr/X11
System Ruby: 1.8.7-249
/usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
Which Perl: /usr/bin/perl
Which Python: /usr/bin/python
Which Ruby: /Users/david/.rvm/rubies/ruby-1.9.2-p290/bin/ruby

~→ brew doctor
Warning: /Library/Frameworks/Mono.framework detected
This can be picked up by CMake's build system and likely cause the build to
fail. You may need to move this file out of the way to compile CMake.

@Sharpie
Copy link
Contributor

Sharpie commented Mar 23, 2012

Well, there is still some unknown X-factor that is causing this to happen. I use 10.7.3 and Xcode 4.3 on my laptop and Postgres works like a champ.

@taglia
Copy link

taglia commented Mar 24, 2012

I'm having the same problem, tried with all 9.1.x versions available in brew.

➜  local git:(master) psql template1
psql (9.1.1)
Type "help" for help.

template1=# \l
[1]    91200 segmentation fault  psql template1
➜  local git:(master) 
➜  local git:(master) brew --config
HOMEBREW_VERSION: 0.9
HEAD: 37e8c5cfb76d35d66fafd0c85bcf3b5d9735dd13
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: 16-core 64-bit arrandale
OS X: 10.7.3
Kernel Architecture: x86_64
Xcode: 4.3.1
GCC-4.0: N/A
GCC-4.2: build 5666
LLVM: build 2336
Clang: 3.0 build 211
MacPorts or Fink? false
X11: /usr/X11
System Ruby: 1.8.7-249
/usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
Which Perl:   /usr/bin/perl
Which Python: /usr/bin/python
Which Ruby:   /Volumes/Mac_Pro_HD/Users/taglia/.rvm/rubies/ruby-1.9.3-p0/bin/ruby
➜  local git:(master)
➜  local git:(master) brew doctor
Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected dylibs:
    /usr/local/lib/libmacfuse_i32.2.dylib    /usr/local/lib/libmacfuse_i64.2.dylib    /usr/local/lib/libosxfuse_i32.2.dylib    /usr/local/lib/libosxfuse_i64.2.dylib

Warning: Unbrewed .la files were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .la files:
    /usr/local/lib/libosxfuse_i32.la    /usr/local/lib/libosxfuse_i64.la

Warning: Unbrewed .pc files were found in /usr/local/lib/pkgconfig.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .pc files:
    /usr/local/lib/pkgconfig/osxfuse.pc
➜  local git:(master)

@danielmt
Copy link

Same problem on 10.7.3, xcode 4.3.2. The database itself works fine, without psql.

psql (9.1.3)
Type "help" for help.

template1=> \d+

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: 13 at address: 0x0000000000000000
0x0000000100016768 in listTables ()

brew --config:

HOMEBREW_VERSION: 0.9
HEAD: eefa3132e25a67c7163e695c347d804c77d064d1
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: quad-core 64-bit sandybridge
OS X: 10.7.3
Kernel Architecture: x86_64
Xcode: 4.3.2
GCC-4.0: N/A
GCC-4.2: build 5666
LLVM: build 2336
Clang: 3.0 build 211
MacPorts or Fink? false
X11: /usr/X11
System Ruby: 1.8.7-249
/usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
Which Perl:   /usr/bin/perl
Which Python: /Users/jdoe/Envs/test/bin/python
Which Ruby:   /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby

brew doctor:

Your system is raring to brew.

@jcstier
Copy link

jcstier commented Apr 7, 2012

Having same issue on 10.7.3 with Xcode 4.3.2 with the psql client.

brew --config
HOMEBREW_VERSION: 0.9
HEAD: 92144d456e3a1bed847a960fa5d47fabfbc9d929
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: 8-core 64-bit sandybridge
OS X: 10.7.3
Kernel Architecture: x86_64
Xcode: 4.3.2
GCC-4.0: build 5494
GCC-4.2: build 5666
LLVM: build 2335
Clang: 2.1 build 163
MacPorts or Fink? false
X11: /usr/X11
System Ruby: 1.8.7-249
/usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
Which Perl: /usr/bin/perl
Which Python: /usr/bin/python
Which Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby

Just trying to do a \d , the client seg faults:

psql (9.1.3)
Type "help" for help.

postgres=# \d
Segmentation fault: 11

I'm seeing the psql client crash on all select statements too.

@adamv
Copy link
Contributor

adamv commented Apr 8, 2012

Please make sure to also install the Command Line Tools from Xcode, to make sure your compiler set is appropriate for Lion.

@davidglassborow
Copy link

Thanks adamv, installed the command line tools using the preferences/downloads, reinstalled pg and it's all fine.

@Sharpie
Copy link
Contributor

Sharpie commented Apr 10, 2012

Ahh, good catch Adam! Should have noticed this earlier.

Everyone who has posted brew --config so far in this thread is using XCode 4.3 or newer. However, you are all showing outdated versions of the Clang compiler---if using XCode 4.3, the Clang version should be reported as:

Clang: 3.1 build 318

Install the command line tools should ensure your PATH contains up to date compilers.

@danielmt
Copy link

I can also confirm that installing the command line tools fixed this on my box.

@Sharpie
Copy link
Contributor

Sharpie commented Apr 12, 2012

Allright. Closing as fixed by #11518 and 7b1ad6e.

@Sharpie Sharpie closed this as completed Apr 12, 2012
@jcstier
Copy link

jcstier commented Apr 13, 2012

I can confirm too. Work perfectly after installing the Xcode command line tools. Thanks!!

@Homebrew Homebrew locked and limited conversation to collaborators Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants