Segmentation fault on postgresql_adapter.rb:607

Frederico Araujo avatarFrederico Araujo created an issue

Hi, i'm having segmentation fault when running PG with in a threaded environment with celluloid and sidekiq gems.

Here is the trace for the segmentation fault: http://pastebin.com/raw.php?i=bc1RMwRQ

it was also reported here: https://bugs.ruby-lang.org/issues/6745

gems: celluloid 0.11.1, timer, sidekiq 2.1.0

Sorry if cant give a better reproducible description. let me know what I can do to help debug it.

cheers.

Comments (20)

  1. larskanis

    Hi Frederico Araujo , looking at the backtrace, this is a usual use case for the pg-gem. There is obviously nothing fancy, I could try to reproduce the issue. So from my point of view, it is essential to get some code to reproduce the crash.

    You could also post the output of the process started per valgrind.

  2. Michael Granger
    • changed status to open

    I agree with Lars; without some code to reproduce the crash, I don't think we'll be able to figure out where the segfault is coming from. Output from valgrind or a 'bt full' from gdb would help a lot.

  3. garysweaver

    Attaching sample database.yml, sample schema creation SQL w/info on how to populate/how much to populate, sample model that should cause issue w/pg 0.14.0, Postgres 9.1.3 (latest postgresql from brew), ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.4.0], Rails 3.2.6, OS X 10.7.4.

    Sorry, this will probably take some work to make anything useful out of it.

  4. garysweaver

    Attaching SQL to create and example model definitions of a few more models showing the same issue. All tables have more than 1 million rows and trying to do a .all on the model, so I think to replicate you might have to try loading a similar amount of data via .all.

  5. Michael Granger

    I've just pushed pg-0.14.1.pre.363.gem, which should fix all the known segfaults. Please test it out in your applications and let me know if still see the problem.

  6. Aaron Cohen

    Sorry, I'm new here: how do I obtain pg-0.14.1.pre ?

    (I'm experiencing this issue, and all my attempted workarounds have failed so far.)

    Preferably, is there any workaround for this bug that I can apply, e.g. by changing the table definition that triggers this bug?

    (Sorry to whine, but learning to use mercurial and figuring out how to build this gem for multiple machine architectures doesn't sound like much fun on my tight schedule.)

  7. Aaron Cohen

    Sweet; thanks!!!!

    Solves the crash too, as well as indicating the cause of the crash - an auto-generated page that I hadn't started editing yet was selecting all rows from a table with hundreds of thousands of rows. My own stupid fault after all. :-)

  8. Michael Granger

    Thanks for the reply Aaron! Glad it fixed it for you. I haven't heard back from anyone else, but I'm going to push out 0.14.1 anyway. Thanks everyone for helping track this one down.

  9. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.