Segfault : crashed on child side of fork pre-exec thread_pool.rb
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?
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