Open jean-francois-labbe opened 1 year ago
Can you get a C level backtrace? It usually looks like here.
Here it is for ruby 3.0.6, can't have the 2.7.8 one:
-- C level backtrace information -------------------------------------------
/usr/local/lib/libruby.so.3.0(rb_print_backtrace+0x11) [0x7fc31c0449ec] vm_dump.c:758
/usr/local/lib/libruby.so.3.0(rb_vm_bugreport) vm_dump.c:998
/usr/local/lib/libruby.so.3.0(rb_bug_for_fatal_signal+0xf0) [0x7fc31be4ef60] error.c:787
/usr/local/lib/libruby.so.3.0(sigsegv+0x49) [0x7fc31bf9c239] signal.c:963
/lib/x86_64-linux-gnu/libpthread.so.0(__restore_rt+0x0) [0x7fc31bd4c140]
/lib/x86_64-linux-gnu/libc.so.6(0x7fc31bac1b2a) [0x7fc31bac1b2a]
/usr/lib/x86_64-linux-gnu/libpq.so.5(0x7fc318090e62) [0x7fc318090e62]
/usr/lib/x86_64-linux-gnu/libpq.so.5(0x7fc31809b5b0) [0x7fc31809b5b0]
/usr/lib/x86_64-linux-gnu/libpq.so.5(PQisBusy+0x3d) [0x7fc31809140d]
/tmp/bundler-cache/3.0.6/ruby/3.0.0/gems/pg-1.5.3/lib/pg_ext.so(gvl_PQisBusy_skeleton+0xc) [0x7fc3180d7f4c] gvl_wrappers.c:14
/usr/local/lib/libruby.so.3.0(rb_nogvl+0xce) [0x7fc31bfe806e] thread.c:1695
/tmp/bundler-cache/3.0.6/ruby/3.0.0/gems/pg-1.5.3/lib/pg_ext.so(gvl_PQisBusy+0x28) [0x7fc3180d8738] gvl_wrappers.c:16
/tmp/bundler-cache/3.0.6/ruby/3.0.0/gems/pg-1.5.3/lib/pg_ext.so(get_result_readable+0x8) [0x7fc3180e1078] pg_connection.c:3005
/tmp/bundler-cache/3.0.6/ruby/3.0.0/gems/pg-1.5.3/lib/pg_ext.so(wait_socket_readable) pg_connection.c:2395
/tmp/bundler-cache/3.0.6/ruby/3.0.0/gems/pg-1.5.3/lib/pg_ext.so(pgconn_async_get_last_result) pg_connection.c:3111
/tmp/bundler-cache/3.0.6/ruby/3.0.0/gems/pg-1.5.3/lib/pg_ext.so(pgconn_async_exec+0x2c) [0x7fc3180e220c] pg_connection.c:3260
/usr/local/lib/libruby.so.3.0(vm_cfp_consistent_p+0x0) [0x7fc31c01b7dc] vm_insnhelper.c:2928
/usr/local/lib/libruby.so.3.0(vm_call_cfunc_with_frame) vm_insnhelper.c:2930
/usr/local/lib/libruby.so.3.0(vm_sendish+0x37f) [0x7fc31c02677f] vm_insnhelper.c:4529
/usr/local/lib/libruby.so.3.0(vm_exec_core+0x94) [0x7fc31c029664] insns.def:789
/usr/local/lib/libruby.so.3.0(rb_vm_exec+0x182) [0x7fc31c02ebd2] vm.c:2162
/usr/local/lib/libruby.so.3.0(rb_call0+0x1e5) [0x7fc31c0345d5] vm_eval.c:72
/usr/local/lib/libruby.so.3.0(rb_call+0x32) [0x7fc31c035022] vm_eval.c:832
/usr/local/lib/libruby.so.3.0(rb_funcallv_kw) vm_eval.c:1032
/usr/local/lib/libruby.so.3.0(rb_class_new_instance_pass_kw+0x4e) [0x7fc31bf03b0e] object.c:2110
/usr/local/lib/libruby.so.3.0(vm_cfp_consistent_p+0x0) [0x7fc31c01b7dc] vm_insnhelper.c:2928
/usr/local/lib/libruby.so.3.0(vm_call_cfunc_with_frame) vm_insnhelper.c:2930
/usr/local/lib/libruby.so.3.0(vm_sendish+0x37f) [0x7fc31c02677f] vm_insnhelper.c:4529
/usr/local/lib/libruby.so.3.0(vm_exec_core+0x94) [0x7fc31c029664] insns.def:789
/usr/local/lib/libruby.so.3.0(rb_vm_exec+0x182) [0x7fc31c02ebd2] vm.c:2162
/usr/local/lib/libruby.so.3.0(rb_call0+0x1e5) [0x7fc31c0345d5] vm_eval.c:72
/usr/local/lib/libruby.so.3.0(rb_call+0x32) [0x7fc31c035022] vm_eval.c:832
/usr/local/lib/libruby.so.3.0(rb_funcallv_kw) vm_eval.c:1032
/usr/local/lib/libruby.so.3.0(rb_class_new_instance_pass_kw+0x4e) [0x7fc31bf03b0e] object.c:2110
/usr/local/lib/libruby.so.3.0(vm_cfp_consistent_p+0x0) [0x7fc31c01b7dc] vm_insnhelper.c:2928
/usr/local/lib/libruby.so.3.0(vm_call_cfunc_with_frame) vm_insnhelper.c:2930
/usr/local/lib/libruby.so.3.0(vm_sendish+0x37f) [0x7fc31c02677f] vm_insnhelper.c:4529
/usr/local/lib/libruby.so.3.0(vm_exec_core+0x94) [0x7fc31c029664] insns.def:789
/usr/local/lib/libruby.so.3.0(rb_vm_exec+0x182) [0x7fc31c02ebd2] vm.c:2162
/usr/local/lib/libruby.so.3.0(yield_under+0x3db) [0x7fc31c03de2b] vm.c:1263
/usr/local/lib/libruby.so.3.0(vm_cfp_consistent_p+0x0) [0x7fc31c01b7dc] vm_insnhelper.c:2928
/usr/local/lib/libruby.so.3.0(vm_call_cfunc_with_frame) vm_insnhelper.c:2930
/usr/local/lib/libruby.so.3.0(vm_call_symbol+0x174) [0x7fc31c03b104] vm_insnhelper.c:3142
/usr/local/lib/libruby.so.3.0(vm_sendish+0x37f) [0x7fc31c02677f] vm_insnhelper.c:4529
/usr/local/lib/libruby.so.3.0(vm_exec_core+0x103) [0x7fc31c0296d3] insns.def:770
/usr/local/lib/libruby.so.3.0(rb_vm_exec+0x182) [0x7fc31c02ebd2] vm.c:2162
/usr/local/lib/libruby.so.3.0(rb_yield+0x25b) [0x7fc31c03c0eb] vm.c:1263
/usr/local/lib/libruby.so.3.0(RB_FL_TEST_RAW+0x0) [0x7fc31bdbb82c] array.c:2523
/usr/local/lib/libruby.so.3.0(RB_FL_ANY_RAW) ./include/ruby/internal/fl_type.h:258
/usr/local/lib/libruby.so.3.0(rb_array_len) ./include/ruby/internal/core/rarray.h:135
/usr/local/lib/libruby.so.3.0(rb_ary_each) array.c:2522
/usr/local/lib/libruby.so.3.0(vm_cfp_consistent_p+0x0) [0x7fc31c01b7dc] vm_insnhelper.c:2928
/usr/local/lib/libruby.so.3.0(vm_call_cfunc_with_frame) vm_insnhelper.c:2930
/usr/local/lib/libruby.so.3.0(vm_sendish+0x37f) [0x7fc31c02677f] vm_insnhelper.c:4529
/usr/local/lib/libruby.so.3.0(vm_exec_core+0x103) [0x7fc31c0296d3] insns.def:770
/usr/local/lib/libruby.so.3.0(rb_vm_exec+0x182) [0x7fc31c02ebd2] vm.c:2162
/usr/local/lib/libruby.so.3.0(catch_i+0x2bc) [0x7fc31c03117c] vm.c:1263
/usr/local/lib/libruby.so.3.0(vm_catch_protect+0xe2) [0x7fc31c021b52] vm_eval.c:2405
/usr/local/lib/libruby.so.3.0(rb_catch_obj+0x4d) [0x7fc31c021d1d] vm_eval.c:2431
/usr/local/lib/libruby.so.3.0(vm_cfp_consistent_p+0x0) [0x7fc31c01b7dc] vm_insnhelper.c:2928
/usr/local/lib/libruby.so.3.0(vm_call_cfunc_with_frame) vm_insnhelper.c:2930
/usr/local/lib/libruby.so.3.0(vm_sendish+0x37f) [0x7fc31c02677f] vm_insnhelper.c:4529
/usr/local/lib/libruby.so.3.0(vm_exec_core+0x103) [0x7fc31c0296d3] insns.def:770
/usr/local/lib/libruby.so.3.0(rb_vm_exec+0x182) [0x7fc31c02ebd2] vm.c:2162
/usr/local/lib/libruby.so.3.0(rb_yield+0x25b) [0x7fc31c03c0eb] vm.c:1263
/usr/local/lib/libruby.so.3.0(RB_FL_TEST_RAW+0x0) [0x7fc31bdbb82c] array.c:2523
/usr/local/lib/libruby.so.3.0(RB_FL_ANY_RAW) ./include/ruby/internal/fl_type.h:258
/usr/local/lib/libruby.so.3.0(rb_array_len) ./include/ruby/internal/core/rarray.h:135
/usr/local/lib/libruby.so.3.0(rb_ary_each) array.c:2522
/usr/local/lib/libruby.so.3.0(vm_cfp_consistent_p+0x0) [0x7fc31c01b7dc] vm_insnhelper.c:2928
/usr/local/lib/libruby.so.3.0(vm_call_cfunc_with_frame) vm_insnhelper.c:2930
/usr/local/lib/libruby.so.3.0(vm_sendish+0x37f) [0x7fc31c02677f] vm_insnhelper.c:4529
/usr/local/lib/libruby.so.3.0(vm_exec_core+0x103) [0x7fc31c0296d3] insns.def:770
/usr/local/lib/libruby.so.3.0(rb_vm_exec+0x182) [0x7fc31c02ebd2] vm.c:2162
/usr/local/lib/libruby.so.3.0(rb_vm_call0+0xd3) [0x7fc31c032513] vm_eval.c:57
/usr/local/lib/libruby.so.3.0(rb_method_call_with_block_kw+0x83) [0x7fc31bf3c003] proc.c:2416
/usr/local/lib/libruby.so.3.0(rb_vm_pop_frame+0x0) [0x7fc31c024e9d] vm_insnhelper.c:3734
/usr/local/lib/libruby.so.3.0(vm_yield_with_cfunc) vm_insnhelper.c:3735
/usr/local/lib/libruby.so.3.0(vm_invoke_ifunc_block) vm_insnhelper.c:3884
/usr/local/lib/libruby.so.3.0(vm_sendish+0x37f) [0x7fc31c02677f] vm_insnhelper.c:4529
/usr/local/lib/libruby.so.3.0(vm_exec_core+0x94) [0x7fc31c029664] insns.def:789
/usr/local/lib/libruby.so.3.0(rb_vm_exec+0x182) [0x7fc31c02ebd2] vm.c:2162
/usr/local/lib/libruby.so.3.0(rb_vm_invoke_proc+0x57) [0x7fc31c031b47] vm.c:1485
/usr/local/lib/libruby.so.3.0(thread_do_start_proc+0x17a) [0x7fc31bfe5dda] thread.c:736
/usr/local/lib/libruby.so.3.0(thread_do_start+0x14) [0x7fc31bfe64f4] thread.c:755
/usr/local/lib/libruby.so.3.0(thread_start_func_2) thread.c:834
/usr/local/lib/libruby.so.3.0(register_cached_thread_and_wait+0x0) [0x7fc31bfe6efa] thread_pthread.c:994
/usr/local/lib/libruby.so.3.0(thread_start_func_1) thread_pthread.c:1001
/lib/x86_64-linux-gnu/libpthread.so.0(0x7ea7) [0x7fc31bd40ea7]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x3f) [0x7fc31ba4ea2f]
I can't provide much information for this, but we're seeing a crash with ruby 2.7.8 on windows with the PG gem, but the only thing windows is reporting about the error is error code -1073740940, which I think is a heap stack corruption.
@larskanis Found the ruby 2.7.8 C backtrace.
-- C level backtrace information -------------------------------------------
/usr/local/lib/libruby.so.2.7(rb_vm_bugreport+0x50a) [0x7f70509feefa] vm_dump.c:755
[0x7f705086fdc7]
/usr/local/lib/libruby.so.2.7(sigsegv+0x49) [0x7f705097bbc9] signal.c:946
/lib/x86_64-linux-gnu/libc.so.6(0x7f7050623d60) [0x7f7050623d60]
/lib/x86_64-linux-gnu/libc.so.6(0x7f705075d911) [0x7f705075d911]
/usr/lib/x86_64-linux-gnu/libpq.so.5(0x7f704caeacf7) [0x7f704caeacf7]
/usr/lib/x86_64-linux-gnu/libpq.so.5(0x7f704caeae65) [0x7f704caeae65]
/usr/lib/x86_64-linux-gnu/libpq.so.5(0x7f704caeaee5) [0x7f704caeaee5]
/usr/lib/x86_64-linux-gnu/libpq.so.5(0x7f704caf5b49) [0x7f704caf5b49]
/usr/lib/x86_64-linux-gnu/libpq.so.5(PQisBusy+0x3d) [0x7f704caec40d]
/tmp/bundler-cache/2.7.8/ruby/2.7.0/gems/pg-1.5.3/lib/pg_ext.so(gvl_PQisBusy_skeleton+0xc) [0x7f704cb32afc] gvl_wrappers.c:14
/usr/local/lib/libruby.so.2.7(rb_nogvl+0x93) [0x7f70509b47b3] thread.c:1474
/tmp/bundler-cache/2.7.8/ruby/2.7.0/gems/pg-1.5.3/lib/pg_ext.so(gvl_PQisBusy+0x28) [0x7f704cb33288] gvl_wrappers.c:16
/tmp/bundler-cache/2.7.8/ruby/2.7.0/gems/pg-1.5.3/lib/pg_ext.so(get_result_readable+0x9) [0x7f704cb36679] pg_connection.c:3005
/tmp/bundler-cache/2.7.8/ruby/2.7.0/gems/pg-1.5.3/lib/pg_ext.so(wait_socket_readable+0x1a5) [0x7f704cb39575] pg_connection.c:2395
/tmp/bundler-cache/2.7.8/ruby/2.7.0/gems/pg-1.5.3/lib/pg_ext.so(pgconn_async_get_last_result+0x52) [0x7f704cb3a942] pg_connection.c:3111
/tmp/bundler-cache/2.7.8/ruby/2.7.0/gems/pg-1.5.3/lib/pg_ext.so(pgconn_async_exec+0x2c) [0x7f704cb3c2cc] pg_connection.c:3260
[0x7f70509de782]
/usr/local/lib/libruby.so.2.7(vm_sendish+0x76) [0x7f70509d9486] vm_insnhelper.c:4023
[0x7f70509e9264]
[0x7f70509eea9b]
/usr/local/lib/libruby.so.2.7(rb_vm_call0+0xbf) [0x7f70509f274f] vm_eval.c:52
/usr/local/lib/libruby.so.2.7(rb_vm_call_kw+0x68) [0x7f70509f2b48] vm_eval.c:268
/usr/local/lib/libruby.so.2.7(rb_funcallv_kw+0x11e) [0x7f70509f876e] vm_eval.c:392
/usr/local/lib/libruby.so.2.7(rb_class_s_new+0x4c) [0x7f7050904b5c] object.c:2152
[0x7f70509de782]
/usr/local/lib/libruby.so.2.7(vm_sendish+0x76) [0x7f70509d9486] vm_insnhelper.c:4023
[0x7f70509e9264]
[0x7f70509eea9b]
/usr/local/lib/libruby.so.2.7(rb_vm_call0+0xbf) [0x7f70509f274f] vm_eval.c:52
/usr/local/lib/libruby.so.2.7(rb_vm_call_kw+0x68) [0x7f70509f2b48] vm_eval.c:268
/usr/local/lib/libruby.so.2.7(rb_funcallv_kw+0x11e) [0x7f70509f876e] vm_eval.c:392
/usr/local/lib/libruby.so.2.7(rb_class_s_new+0x4c) [0x7f7050904b5c] object.c:2152
[0x7f70509de782]
/usr/local/lib/libruby.so.2.7(vm_sendish+0x76) [0x7f70509d9486] vm_insnhelper.c:4023
[0x7f70509e9264]
[0x7f70509eea9b]
/usr/local/lib/libruby.so.2.7(yield_under+0x1be) [0x7f70509fa4de] vm.c:1171
[0x7f70509de782]
/usr/local/lib/libruby.so.2.7(vm_call_opt_send+0x2bd) [0x7f70509f115d] vm_insnhelper.c:2661
/usr/local/lib/libruby.so.2.7(vm_sendish+0x76) [0x7f70509d9486] vm_insnhelper.c:4023
[0x7f70509e92d3]
[0x7f70509eea9b]
/usr/local/lib/libruby.so.2.7(rb_yield+0x75) [0x7f70509fada5] vm.c:1179
/usr/local/lib/libruby.so.2.7(rb_ary_each+0x2c) [0x7f70507fef1c] array.c:2135
/usr/local/lib/libruby.so.2.7(rb_ary_each) array.c:2129
[0x7f70509de782]
/usr/local/lib/libruby.so.2.7(vm_sendish+0x76) [0x7f70509d9486] vm_insnhelper.c:4023
[0x7f70509e92d3]
[0x7f70509eea9b]
/usr/local/lib/libruby.so.2.7(catch_i+0x58) [0x7f70509fab28] vm.c:1179
/usr/local/lib/libruby.so.2.7(vm_catch_protect+0xb4) [0x7f70509e2f44] vm_eval.c:2310
/usr/local/lib/libruby.so.2.7(rb_catch_obj+0x2a) [0x7f70509e303a] vm_eval.c:2336
[0x7f70509de782]
/usr/local/lib/libruby.so.2.7(vm_sendish+0x76) [0x7f70509d9486] vm_insnhelper.c:4023
[0x7f70509e92d3]
[0x7f70509eea9b]
/usr/local/lib/libruby.so.2.7(rb_yield+0x75) [0x7f70509fada5] vm.c:1179
/usr/local/lib/libruby.so.2.7(rb_ary_each+0x2c) [0x7f70507fef1c] array.c:2135
/usr/local/lib/libruby.so.2.7(rb_ary_each) array.c:2129
[0x7f70509de782]
/usr/local/lib/libruby.so.2.7(vm_sendish+0x76) [0x7f70509d9486] vm_insnhelper.c:4023
[0x7f70509e92d3]
[0x7f70509eea9b]
/usr/local/lib/libruby.so.2.7(rb_vm_call0+0xbf) [0x7f70509f274f] vm_eval.c:52
/usr/local/lib/libruby.so.2.7(rb_vm_call_kw+0x68) [0x7f70509f2b48] vm_eval.c:268
[0x7f70509352f0]
/usr/local/lib/libruby.so.2.7(vm_yield_with_cfunc+0xed) [0x7f70509e540d] vm_insnhelper.c:3220
/usr/local/lib/libruby.so.2.7(vm_invoke_ifunc_block+0x69) [0x7f70509e54d9] vm_insnhelper.c:3381
/usr/local/lib/libruby.so.2.7(vm_sendish+0x76) [0x7f70509d9486] vm_insnhelper.c:4023
[0x7f70509e9264]
[0x7f70509eea9b]
[0x7f70509b28f4]
[0x7f70509b4e2c]
/usr/local/lib/libruby.so.2.7(thread_start_func_1+0xba) [0x7f70509b53da] thread_pthread.c:969
/lib/x86_64-linux-gnu/libpthread.so.0(start_thread+0xd7) [0x7f70505b3ea7]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x3f) [0x7f70506e7a2f]
Both ruby versions crash on PQisBusy
. This function has a single argument, which is the PQconn
pointer. For me it looks like the PQconn
was released for some reason or points to some invalid memory for some reason. I don't have an idea why this should happen.
The only other reason for a crash, I could imagine, is that the PQconn
is used concurrently by two threads, but that should lead to some invalid message warnings in addition to the segfault.
It could help to reproduce the segfault in a gdb session. On modern Linux distributions like Ubuntu-23.04, gdb asks for download of debug symbols of system libraries, so that we could see, within which function and source line libpq crashes.
Beside this I don't have a good idea for now. So far it's the only bug report of this kind.
Same issue here.
Same issue:
/usr/share/rvm/gems/ruby-3.0.4/gems/pg-1.4.5/lib/pg/connection.rb:626: [BUG] Segmentation fault at 0x00007fb3e97f3140
ruby 3.0.4p208 (2022-04-12 revision 3fa771dded) [x86_64-linux]
similar issue with ruby 3.0.x
and pg 1.5.3
Started GET "/" for ::1 at 2023-07-12 20:33:00 +0545
/Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/pg-1.5.3/lib/pg/connection.rb:690: [BUG] Segmentation fault at 0x00000001041a0ae0
ruby 3.0.6p216 (2023-03-30 revision 23a532679b) [arm64-darwin22]
-- Control frame information -----------------------------------------------
c:0084 p:---- s:0595 e:000594 CFUNC :connect_poll
c:0083 p:0543 s:0591 e:000590 METHOD /Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/pg-1.5.3/lib/pg/connection.rb:690
c:0082 p:0354 s:0578 e:000577 METHOD /Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/pg-1.5.3/lib/pg/connection.rb:824
c:0081 p:0007 s:0567 e:000566 METHOD /Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/pg-1.5.3/lib/pg/connection.rb:759
c:0080 p:0019 s:0561 e:000560 METHOD /Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/pg-1.5.3/lib/pg.rb:63
c:0079 p:0013 s:0555 e:000554 METHOD /Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/activerecord-7.0.5.1/lib/active_record/connection_adapters/postgres
c:0078 p:0112 s:0549 e:000547 METHOD /Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/activerecord-7.0.5.1/lib/active_record/connection_adapters/postgres [FINISH]
c:0077 p:---- s:0541 e:000540 CFUNC :public_send
c:0076 p:0021 s:0535 e:000534 METHOD /Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/activerecord-7.0.5.1/lib/active_record/connection_adapters/abstract
c:0075 p:0021 s:0531 e:000530 METHOD /Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/activerecord-7.0.5.1/lib/active_record/connection_adapters/abstract
c:0074 p:0014 s:0527 e:000526 METHOD /Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/activerecord-7.0.5.1/lib/active_record/connection_adapters/abstract
c:0073 p:0012 s:0521 e:000520 METHOD /Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/activerecord-7.0.5.1/lib/active_record/connection_adapters/abstract
c:0072 p:0011 s:0515 e:000513 METHOD /Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/activerecord-7.0.5.1/lib/active_record/connection_adapters/abstract
c:0071 p:0021 s:0509 e:000505 METHOD /Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/activerecord-7.0.5.1/lib/active_record/connection_adapters/abstract
c:0070 p:0291 s:0502 e:000501 METHOD /Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/activerecord-7.0.5.1/lib/active_record/connection_adapters/abstract
c:0069 p:0014 s:0492 e:000491 METHOD /Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/activerecord-7.0.5.1/lib/active_record/connection_handling.rb:313
c:0068 p:0003 s:0488 e:000487 METHOD /Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/activerecord-7.0.5.1/lib/active_record/connection_handling.rb:280
c:0067 p:0015 s:0484 e:000483 METHOD /Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/activerecord-7.0.5.1/lib/active_record/migration.rb:613
c:0066 p:0004 s:0480 e:000478 METHOD /Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/activerecord-7.0.5.1/lib/active_record/migration.rb:608
c:0065 p:0012 s:0473 e:000472 BLOCK /Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/activerecord-7.0.5.1/lib/active_record/migration.rb:590 [FINISH]
c:0064 p:---- s:0470 e:000469 CFUNC :synchronize
c:0063 p:0006 s:0466 e:000465 METHOD /Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/activerecord-7.0.5.1/lib/active_record/migration.rb:589
c:0062 p:0008 s:0461 e:000460 BLOCK /Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/actionpack-7.0.5.1/lib/action_dispatch/middleware/callbacks.rb:27
c:0061 p:0024 s:0458 e:000457 METHOD /Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/activesupport-7.0.5.1/lib/active_support/callbacks.rb:99
c:0060 p:0009 s:0449 e:000448 METHOD /Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/actionpack-7.0.5.1/lib/action_dispatch/middleware/callbacks.rb:26
c:0059 p:0016 s:0442 e:000441 METHOD /Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/actionpack-7.0.5.1/lib/action_dispatch/middleware/executor.rb:14
c:0058 p:0033 s:0433 e:000432 METHOD /Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/actionpack-7.0.5.1/lib/action_dispatch/middleware/actionable_except
c:0057 p:0007 s:0427 e:000426 METHOD /Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/ddtrace-1.3.0/lib/datadog/tracing/contrib/rails/middlewares.rb:19
c:0056 p:0007 s:0420 e:000419 METHOD /Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/better_errors-2.10.1/lib/better_errors/middleware.rb:87
c:0055 p:0025 s:0414 e:000413 METHOD /Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/better_errors-2.10.1/lib/better_errors/middleware.rb:82
c:0054 p:0012 s:0409 e:000408 METHOD /Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/better_errors-2.10.1/lib/better_errors/middleware.rb:60
c:0053 p:0026 s:0404 e:000403 METHOD /Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/actionpack-7.0.5.1/lib/action_dispatch/middleware/debug_exceptions.
c:0052 p:0007 s:0393 e:000392 METHOD /Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/web-console-4.2.0/lib/web_console/middleware.rb:132
c:0051 p:0069 s:0387 e:000386 BLOCK /Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/web-console-4.2.0/lib/web_console/middleware.rb:28 [FINISH]
c:0050 p:---- s:0377 e:000376 CFUNC :catch
c:0049 p:0006 s:0372 e:000371 METHOD /Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/web-console-4.2.0/lib/web_console/middleware.rb:17
c:0048 p:0007 s:0365 e:000364 METHOD /Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/honeycomb-beeline-2.11.0/lib/honeycomb/integrations/rack.rb:80
c:0047 p:0008 s:0358 e:000357 METHOD /Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/honeycomb-beeline-2.11.0/lib/honeycomb/integrations/rails.rb:94
c:0046 p:0058 s:0349 E:001f38 BLOCK /Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/honeycomb-beeline-2.11.0/lib/honeycomb/integrations/rack.rb:53
c:0045 p:0035 s:0341 e:000340 METHOD /Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/honeycomb-beeline-2.11.0/lib/honeycomb/client.rb:65
c:0044 p:0032 s:0331 E:001ef0 METHOD /Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/honeycomb-beeline-2.11.0/lib/honeycomb/integrations/rack.rb:37
c:0043 p:0026 s:0325 e:000324 METHOD /Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/actionpack-7.0.5.1/lib/action_dispatch/middleware/show_exceptions.r
c:0042 p:0049 s:0318 E:002460 METHOD /Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/railties-7.0.5.1/lib/rails/rack/logger.rb:40
c:0041 p:0008 s:0306 e:000305 BLOCK /Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/railties-7.0.5.1/lib/rails/rack/logger.rb:25
c:0040 p:0004 s:0303 e:000302 BLOCK /Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/activesupport-7.0.5.1/lib/active_support/tagged_logging.rb:99
c:0039 p:0012 s:0300 e:000299 METHOD /Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/activesupport-7.0.5.1/lib/active_support/tagged_logging.rb:37
c:0038 p:0015 s:0294 e:000293 METHOD /Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/activesupport-7.0.5.1/lib/active_support/tagged_logging.rb:99
c:0037 p:0039 s:0288 e:000287 METHOD /Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/railties-7.0.5.1/lib/rails/rack/logger.rb:25
c:0036 p:0040 s:0282 e:000281 METHOD /Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/ahoy_matey-4.2.1/lib/ahoy/engine.rb:22
c:0035 p:0038 s:0277 e:000276 METHOD /Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/sprockets-rails-3.4.2/lib/sprockets/rails/quiet_assets.rb:13
c:0034 p:0052 s:0272 e:000271 METHOD /Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/actionpack-7.0.5.1/lib/action_dispatch/middleware/remote_ip.rb:93
-- Ruby level backtrace information ----------------------------------------
/Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/puma-5.6.6/lib/puma/thread_pool.rb:147:in `block in spawn_thread'
/Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/puma-5.6.6/lib/puma/server.rb:443:in `process_client'
/Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/puma-5.6.6/lib/puma/request.rb:76:in `handle_request'
/Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/puma-5.6.6/lib/puma/thread_pool.rb:340:in `with_force_shutdown'
/Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/puma-5.6.6/lib/puma/request.rb:77:in `block in handle_request'
/Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/puma-5.6.6/lib/puma/configuration.rb:252:in `call'
/Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/railties-7.0.5.1/lib/rails/engine.rb:530:in `call'
/Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/rack-proxy-0.7.6/lib/rack/proxy.rb:87:in `call'
/Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/webpacker-5.4.4/lib/webpacker/dev_server_proxy.rb:25:in `perform_request'
...
/Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/activerecord-7.0.5.1/lib/active_record/migration.rb:608:in `build_watcher'
/Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/activerecord-7.0.5.1/lib/active_record/migration.rb:613:in `connection'
/Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/activerecord-7.0.5.1/lib/active_record/connection_handling.rb:280:in `connection'
/Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/activerecord-7.0.5.1/lib/active_record/connection_handling.rb:313:in `retrieve_connection'
/Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/activerecord-7.0.5.1/lib/active_record/connection_adapters/abstract/connection_handler.rb:211:in `retrieve_connection'
/Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/activerecord-7.0.5.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:181:in `connection'
/Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/activerecord-7.0.5.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:341:in `checkout'
/Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/activerecord-7.0.5.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:640:in `acquire_connection'
/Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/activerecord-7.0.5.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:679:in `try_to_checkout_new_connection'
/Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/activerecord-7.0.5.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:700:in `checkout_new_connection'
/Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/activerecord-7.0.5.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:656:in `new_connection'
/Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/activerecord-7.0.5.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:656:in `public_send'
/Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/activerecord-7.0.5.1/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `postgresql_connection'
/Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/activerecord-7.0.5.1/lib/active_record/connection_adapters/postgresql_adapter.rb:78:in `new_client'
/Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/pg-1.5.3/lib/pg.rb:63:in `connect'
/Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/pg-1.5.3/lib/pg/connection.rb:759:in `new'
/Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/pg-1.5.3/lib/pg/connection.rb:824:in `connect_to_hosts'
/Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/pg-1.5.3/lib/pg/connection.rb:690:in `async_connect_or_reset'
/Users/dhurbabaral/code/forem/vendor/bundle/ruby/3.0.0/gems/pg-1.5.3/lib/pg/connection.rb:690:in `connect_poll'
Update:
export PGGSSENCMODE="disable"
worked for me ref: https://github.com/ged/ruby-pg/issues/538#issuecomment-1591629049
FYI, you can also use ?gssencmode=disable
in the connection url param to disable this, or set gssencmode: disable right in config/database.yml.
Edit: while this helped, it didn't fix it in all cases
Hi, We're facing a Segmentation fault with ruby 2.7.4 and pg 1.4.6 in a rails application (v6.1.7) in the mx-linux
/home/brijesh/.rvm/gems/ruby-2.7.4@referalgps/gems/pg-1.4.6/lib/pg/connection.rb:627: [BUG] Segmentation fault at 0x0000000000000000 ruby 2.7.4p191 (2021-07-07 revision a21a3b7d23) [x86_64-linux]
Hi, We're facing a Segmentation fault with ruby 2.7.8 and pg 1.5.3 in a rails application (v6.1.7). This is sometimes happening in CI. It is sometimes reproducible locally but I haven't found the right conditions to always reproduce the issue.
Stack trace
Actual failing code
Is there anything I can try to fix it ? Maybe the answer is to just upgrade ruby version.
[EDIT] Also seeing the issue with ruby 3.0.6 The stack trace has more details with this ruby version.