Comments (20)
Original comment by Anonymous.
I should say, this is with OSX Snow Leopard; and both postgresql and pg gem installed with arch x86-64
from ruby-pg.
Original comment by Michael Granger (Bitbucket: ged, GitHub: ged).
Oy, I'm not sure how to help troubleshoot this. If you can get a backtrace from gdb (either via a core or by starting the server from it) that will at least narrow down where it's coming from. Are there any other gems with extensions being loaded that might somehow conflict with pg?
If you can strip it down to a minimal test case, I can try to duplicate it from a gdb session as well.
from ruby-pg.
Original comment by Anonymous.
Michael, I'm getting a similar issue from that above, though I've experience it with 1.9.2 with Rails 3 as well as Sinatra 1.0. I haven't been able to isolate the exact issue from what is happening.
Basically, We're using ruby-protobuf (though I've modified the rpc portion of the gem quite heavily) to talk between services in our application. Running the application locally in any env works fine, but when hitting another service through protobuf (the "server" end, not client), the server ends up getting killed by ActiveRecord's inclusion of the pg gem, specifically with a Trace Trap.
I'm not sure how to get you a backtrace of this, but would love to do so if you could point me in the right direction. This only happens in mac osx, as we've deployed this to ubuntu 10.0.4 and it's running fine.
Not sure how I can get an update on this (other than checking back), but you can email me directly at bj [dot] neilsen [at] gmail
from ruby-pg.
Original comment by BJ Neilsen (Bitbucket: localshred, GitHub: localshred).
Michael, I've created an account so that you can access me on this (I'm the most recent commenter). Thanks, and hope to hear from you soon.
from ruby-pg.
Original comment by Anonymous.
I'm hitting this on Snow Leopard with Ruby 1.9.2 + ActiveRecord + Sinatra. If I replace Ruby by the version 1.8.7, it all works fine.
from ruby-pg.
Original comment by Joel Lopes Da Silva (Bitbucket: JoeKun, GitHub: JoeKun).
I just created an account too, so you could reach me more easily (I'm the most recent commenter now). I'm very willing to help with this, by providing any information you need and testing roots if you want to. In the meantime, I just got a gdb backtrace for you. You'll find it as an attachment to this comment. I hope this helps.
from ruby-pg.
Original comment by Michael Granger (Bitbucket: ged, GitHub: ged).
Sorry I haven't replied in a while. I got caught up with work and my RubyConf presentation, but I have a bit more time now.
If you want updates on this issue, you can click on the 'Follow' icon at the top, which will cause updates to notify you.
I've looked at the backtrace supplied by JoeKun (thanks for uploading it!), but to be honest it's a bit baffling. I've never seen frames like the 'ImageLoader' ones:
#0 0x00007fff83409570 in __CFInitialize ()
#1 0x00007fff5fc0d5ce in __dyld__ZN16ImageLoaderMachO11doImageInitERKN11ImageLoader11LinkContextE ()
#2 0x00007fff5fc0d607 in __dyld__ZN16ImageLoaderMachO16doInitializationERKN11ImageLoader11LinkContextE ()
#3 0x00007fff5fc0bcec in __dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEj ()
#4 0x00007fff5fc0bc9d in __dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEj ()
#5 0x00007fff5fc0bc9d in __dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEj ()
#6 0x00007fff5fc0bc9d in __dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEj ()
#7 0x00007fff5fc0bda6 in __dyld__ZN11ImageLoader15runInitializersERKNS_11LinkContextE ()
#8 0x00007fff5fc08fbb in __dyld_dlopen ()
#9 0x00007fff828f13a0 in dlopen ()
#10 0x0000000100003a80 in dln_load (file=0x10089a200
"[...]/.rvm/gems/ruby-1.9.2-p0@lst/gems/pg-0.9.0/lib/pg_ext.bundle")
at dln.c:1276
#11 0x0000000100164af5 in vm_pop_frame [inlined] ()
at [...]/.rvm/src/ruby-1.9.2-p0/vm_insnhelper.c:1463
It looks a bit like OSX's linker is linking in something that conflicts somehow, but I'm a bit out of my depth when it comes to debugging dynamic linker problems. It doesn't appear to be unique to the 'pg' library, however, at least if things like this are any indication:
http://pastie.org/pastes/603120
It's from a Python program (obviously), but the backtrace from Thread 2 looks pretty much identical, for what that's worth.
I'll keep digging.
from ruby-pg.
Original comment by Michael Granger (Bitbucket: ged, GitHub: ged).
I've searched pretty exhaustively looking for clues as to what the issue could be with this, but I'm coming up empty. The only difference between the gem under 1.8.7 and 1.9.2 is the support for Encodings, but I can't see why that would result in a linker error at runtime.
Without a way to reproduce this myself, or access to an environment in which it occurs, I'm not what else I can do.
I'd at least be interested in knowing if it still happens with 0.10.0. Anyone tried that out yet?
from ruby-pg.
Original comment by Joel Lopes Da Silva (Bitbucket: JoeKun, GitHub: JoeKun).
Hi Michael,
Thanks for looking into this. I just tried the same thing with 0.10.0 (I did gem update, and I saw this in the output: "Successfully installed pg-0.10.0"). I hit the exact same problem.
So I'll try to prepare a sample project that shows the problem. I don't really have time to do it right now, but I'll try to get it done by the end of the week. That way you'll be able to reproduce the problem.
Cheers,
from ruby-pg.
Original comment by Michael Granger (Bitbucket: ged, GitHub: ged).
Excellent! Thanks in advance. :)
from ruby-pg.
Original comment by Joel Lopes Da Silva (Bitbucket: JoeKun, GitHub: JoeKun).
You'll find the sample code attached to this message (cf. ruby-192_activerecord-3_pg-010_launching-server-crash_test-sample.tar.bz2).
Here are instructions:
# Install PostgreSQL (tested with 9.0.1), and launch it
# Install rvm (cf. http://spyrestudios.com/setting-up-a-rails-development-system-on-mac-osx-snow-leopard/)
# Setup the database
tar xvjf ~/Downloads/ruby-192_activerecord-3_pg-010_launching-server-crash_test-sample.tar.bz2
cd ruby-192_activerecord-3_pg-010_launching-server-crash_test-sample
createuser --no-createdb --no-createrole --no-superuser --no-password testuser
createdb --owner=testuser testdb
psql --username=testuser testdb < create_testdb_tables.sql
# Make sure it works with Ruby 1.8.7
rvm install 1.8.7
rvm use --create 1.8.7@pg-test
gem install sinatra json activerecord pg
ruby WebService.rb
curl -i -X GET http://localhost:4567/tests # in another terminal window
# You should get something like:
#
# HTTP/1.1 200 OK
# Connection: Keep-Alive
# Content-Type: text/html;charset=utf-8
# Date: Thu, 02 Dec 2010 21:37:06 GMT
# Server: WEBrick/1.3.1 (Ruby/1.8.7/2010-08-16)
# Content-Length: 55
#
# ["First test","Second test","Third test","Fourth test"]
# Hit ^+C
# Make sure it crashes with Ruby 1.9.2
rvm install 1.9.2
rvm use --create 1.9.2@pg-test
gem install sinatra json activerecord pg
ruby WebService.rb
curl -i -X GET http://localhost:4567/tests # in another terminal window
# You should get something like:
#
# curl: (52) Empty reply from server
# Hit ^+C
from ruby-pg.
Original comment by Michael Granger (Bitbucket: ged, GitHub: ged).
First of all, thanks so much for putting together a test case! Unfortunately, I can't reproduce the problem on either of two MacOS X machines. I get:
$ rvm 1.9.2 ruby WebService.rb
== Sinatra/1.1.0 has taken the stage on 4567 for development with backup from Thin
>> Thin web server (v1.2.7 codename No Hup)
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:4567, CTRL+C to stop
127.0.0.1 - - [06/Dec/2010 08:27:36] "GET /tests HTTP/1.1" 200 55 0.7836
^C>> Stopping ...
== Sinatra has ended his set (crowd applauds)
$ psql --version
psql (PostgreSQL) 9.0.1
contains support for command-line editing
and in the other terminal:
$ curl -i -X GET http://localhost:4567/tests
HTTP/1.1 200 OK
Content-Type: text/html;charset=utf-8
Content-Length: 55
Connection: keep-alive
Server: thin 1.2.7 codename No Hup
["First test","Second test","Third test","Fourth test"]
How is your PostgreSQL installed? I have mine installed via MacPorts on both machines.
from ruby-pg.
Original comment by Michael Granger (Bitbucket: ged, GitHub: ged).
Thinking that perhaps it was caused by Webrick, I tried after uninstalling Thin as well:
$ curl -i -X GET http://localhost:4567/tests
HTTP/1.1 200 OK
Content-Type: text/html;charset=utf-8
Content-Length: 55
Server: WEBrick/1.3.1 (Ruby/1.9.2/2010-08-18)
Date: Mon, 06 Dec 2010 16:33:00 GMT
Connection: Keep-Alive
["First test","Second test","Third test","Fourth test"]
from ruby-pg.
Original comment by Michael Granger (Bitbucket: ged, GitHub: ged).
On hold until we can figure out some way to duplicate it, or I have access to an environment which exhibits the problem.
from ruby-pg.
Original comment by Johan Eckerström (Bitbucket: jage, GitHub: jage).
I have the same problem with pg 0.10.1 (x86-64), Ruby 1.9.2, Rails 3.0.3 and WEBrick 1.3.1. No problem when using thin 1.2.7 instead of WEBrick though.
If needed, I can provide a shell for debugging. (send private message)
from ruby-pg.
Original comment by Anonymous.
Same configuration as jage, same problem
webrick + pg = crash
webrick + sqlite3 = ok
thin + pg = ok
from ruby-pg.
Original comment by Anonymous.
Seeing the same issue here. This problem only occurs on our Mac development machines using webrick. Our Engine Yard hosted production servers work fine. MySQL and sqlite on the Macs work fine as well.
Mac OS X 10.6.8, Rails 3.0.9, EnterpriseDB Postgresql 9.0, Ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.8.0] (under RVM), pg (0.11.0)
Let me know if there are any logs / debug output I can provide
from ruby-pg.
Original comment by Anonymous.
Seeing the same issue here. This problem only occurs on our Mac development machines using webrick. Our Engine Yard hosted production servers work fine. MySQL and sqlite on the Macs work fine as well.
Mac OS X 10.6.8, Rails 3.0.9, EnterpriseDB Postgresql 9.0, Ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.8.0] (under RVM), pg (0.11.0)
Let me know if there are any logs / debug output I can provide
from ruby-pg.
Original comment by Anonymous.
im having this problem on one of my apps on MAC OS X LION with pg 0.11.0 ruby 1.9.2-180 and ruby 1.9.2-290 on rvm
from ruby-pg.
Original comment by Anonymous.
I'm getting the same problem when using with Sequel and Sinatra
from ruby-pg.
Related Issues (20)
- Segmentation fault HOT 28
- Sonoma: getaddrinfo segmentation fault HOT 2
- Segmentation fault in ruby:3.2.2-alpine3.18 docker image HOT 2
- Wrong binary conversion on x86 (32bit intel) arch causing test failures HOT 4
- Bad IAM Token against Amazon Aurora Postgres: Out of memory error HOT 2
- Attempting to execute a sql file with `\set ...` raises errors HOT 3
- conn.exec writing "INFO" statements to stderr instead of stdout HOT 2
- Segfault on ruby 3.2.2, pg 1.5.4 HOT 2
- Error ruby(39749,0x1e1f05300) malloc: double free for ptr 0x13c6bfa00 HOT 1
- Segmentation fault when connecting to RDS HOT 11
- Broken links in documentation HOT 3
- connection.reset don't check again DNS HOT 6
- Usage with ApacheAGE for Postgresql HOT 2
- Add BigDecimal to gemspec for Ruby 3.3/4 HOT 2
- Binary Windows gem no longer available for Ruby v3.3 since v1.5.6 HOT 2
- Test failure with modified `RUBY_PG_TEST_DIR` HOT 2
- Q: Is it possible to handle composite values like `row(123, 'str', true)` ? HOT 1
- Dereference of null in alloc_query_params HOT 1
- TypeError PG::TypeMap undefined method `key?' for nil if !type_map.key?(oid) HOT 2
- Query hangs when using async_exec HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ruby-pg.