Bug #16369
closedSegfault : crashed on child side of fork pre-exec thread_pool.rb
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
Updated by j15e (Jean-Philippe Doyle) almost 5 years 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) over 4 years 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