Project

General

Profile

Bug #16369

Segfault : crashed on child side of fork pre-exec thread_pool.rb

Added by j15e (Jean-Philippe Doyle) 7 months ago. Updated about 1 month ago.

Status:
Third Party's Issue
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin18]
[ruby-core:95946]
Tags:

Description

It occurs at random in development on my rails 6 app with puma server, so unfortunately I do not have very reproducible steps.

Maybe someone with more knowledge of ruby crash reports could suggest some hints?


Files

console.txt (467 KB) console.txt j15e (Jean-Philippe Doyle), 11/26/2019 12:48 AM
ruby_2019-11-25-193430_jpdoyle-mbp-636.crash (113 KB) ruby_2019-11-25-193430_jpdoyle-mbp-636.crash j15e (Jean-Philippe Doyle), 11/26/2019 12:49 AM

Updated by j15e (Jean-Philippe Doyle) 7 months ago

After a bit more research, I think this might be the same issue as https://bugs.ruby-lang.org/issues/16288#note-2 so feel free to close if that is the case

Updated by jeremyevans0 (Jeremy Evans) about 1 month ago

  • Status changed from Open to Third Party's Issue

This crashes inside the pg gem: https://github.com/ged/ruby-pg/blob/v1.1.4/ext/pg_connection.c#L3221-L3240. My guess is you are not disconnecting before forking and you end up sharing connections between processes, which can easily cause segfaults. Always disconnect database connections before forking if using a forking webserver.

If you can reproduce the example with just the pg gem and without forking, you should try reporting the issue to the pg gem maintainers: https://github.com/ged/ruby-pg/issues

Also available in: Atom PDF