Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PG Patch Segmentation Fault #449

Closed
zacheryph opened this issue May 1, 2023 · 8 comments
Closed

PG Patch Segmentation Fault #449

zacheryph opened this issue May 1, 2023 · 8 comments
Labels
bug Something isn't working

Comments

@zacheryph
Copy link
Contributor

We randomly see segmentation faults within opentelemetry-instrumentation-pg (0.24).

This does not seem to affect our application though I did not see a report of it either.

Share details about your runtime

Operating system details: Linux, Ubuntu 20.04.6 LTS (Heroku)
RUBY_ENGINE: "ruby"
RUBY_VERSION: "3.1.4"
RUBY_DESCRIPTION: "ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]"

opentelemetry-api: 1.1.0
opentelemetry-common: 0.19.6
opentelemetry-sdk: 1.2.0

Backtrace

/app/vendor/bundle/ruby/3.1.0/gems/opentelemetry-instrumentation-pg-0.24.0/lib/opentelemetry/instrumentation/pg/patches/connection.rb:20: [BUG] Segmentation fault at 0x000000000000009e 
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux] 
-- Control frame information ----------------------------------------------- 
c:0199 p:---- s:1279 e:001278 CFUNC  :exec_params 
c:0198 p:0008 s:1273 e:001272 BLOCK  /app/vendor/bundle/ruby/3.1.0/gems/opentelemetry-instrumentation-pg-0.24.0/lib/opentelemetry/instrumentation/pg/patches/connect 
c:0197 p:0006 s:1270 e:001269 BLOCK  /app/vendor/bundle/ruby/3.1.0/gems/opentelemetry-api-1.1.0/lib/opentelemetry/trace.rb:72 
c:0196 p:0024 s:1265 e:001264 METHOD /app/vendor/bundle/ruby/3.1.0/gems/opentelemetry-api-1.1.0/lib/opentelemetry/context.rb:87 
c:0195 p:0023 s:1257 e:001256 METHOD /app/vendor/bundle/ruby/3.1.0/gems/opentelemetry-api-1.1.0/lib/opentelemetry/trace.rb:72 
c:0194 p:0035 s:1252 e:001251 METHOD /app/vendor/bundle/ruby/3.1.0/gems/opentelemetry-api-1.1.0/lib/opentelemetry/trace/tracer.rb:29 
c:0193 p:0028 s:1239 e:001238 BLOCK  /app/vendor/bundle/ruby/3.1.0/gems/opentelemetry-instrumentation-pg-0.24.0/lib/opentelemetry/instrumentation/pg/patches/connect [FINISH] 
c:0192 p:0011 s:1233 e:001232 BLOCK  /app/vendor/bundle/ruby/3.1.0/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/postgresql_adapter.rb:672 
c:0191 p:0002 s:1230 e:001229 BLOCK  /app/vendor/bundle/ruby/3.1.0/gems/activesupport-6.1.7.3/lib/active_support/dependencies/interlock.rb:48 
c:0190 p:0022 s:1227 e:001226 METHOD /app/vendor/bundle/ruby/3.1.0/gems/activesupport-6.1.7.3/lib/active_support/concurrency/share_lock.rb:187 
c:0189 p:0008 s:1217 e:001216 METHOD /app/vendor/bundle/ruby/3.1.0/gems/activesupport-6.1.7.3/lib/active_support/dependencies/interlock.rb:47 
c:0188 p:0018 s:1213 e:001212 BLOCK  /app/vendor/bundle/ruby/3.1.0/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/postgresql_adapter.rb:671 
c:0187 p:0002 s:1210 e:001209 BLOCK  /app/vendor/bundle/ruby/3.1.0/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract_adapter.rb:696 
c:0186 p:0002 s:1207 e:001206 BLOCK  /app/vendor/bundle/ruby/3.1.0/gems/activesupport-6.1.7.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26 [FINISH] 
c:0185 p:---- s:1204 e:001203 CFUNC  :handle_interrupt 
c:0184 p:0026 s:1199 e:001198 BLOCK  /app/vendor/bundle/ruby/3.1.0/gems/activesupport-6.1.7.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25 [FINISH] 
c:0183 p:---- s:1196 e:001195 CFUNC  :handle_interrupt 
c:0182 p:0021 s:1191 e:001190 METHOD /app/vendor/bundle/ruby/3.1.0/gems/activesupport-6.1.7.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21 
c:0181 p:0007 s:1187 e:001186 BLOCK  /app/vendor/bundle/ruby/3.1.0/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract_adapter.rb:695 
c:0180 p:0022 s:1183 e:001182 METHOD /app/vendor/bundle/ruby/3.1.0/gems/activesupport-6.1.7.3/lib/active_support/notifications/instrumenter.rb:24 
c:0179 p:0034 s:1175 e:001174 METHOD /app/vendor/bundle/ruby/3.1.0/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract_adapter.rb:687 
c:0178 p:0033 s:1166 e:001165 METHOD /app/vendor/bundle/ruby/3.1.0/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/postgresql_adapter.rb:670 
c:0177 p:0061 s:1158 e:001157 METHOD /app/vendor/bundle/ruby/3.1.0/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/postgresql_adapter.rb:649 
c:0176 p:0020 s:1147 e:001146 METHOD /app/vendor/bundle/ruby/3.1.0/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/postgresql/database_statements.rb 
c:0175 p:0018 s:1138 e:001137 METHOD /app/vendor/bundle/ruby/3.1.0/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/database_statements.rb:5 
c:0174 p:0061 s:1131 e:001130 METHOD /app/vendor/bundle/ruby/3.1.0/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/database_statements.rb:6 
c:0173 p:0012 s:1121 e:001120 BLOCK  /app/vendor/bundle/ruby/3.1.0/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/query_cache.rb:101 
c:0172 p:0066 s:1118 e:001114 BLOCK  /app/vendor/bundle/ruby/3.1.0/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/query_cache.rb:118 
c:0171 p:0002 s:1111 e:001110 BLOCK  /app/vendor/bundle/ruby/3.1.0/gems/activesupport-6.1.7.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26 [FINISH] 
c:0170 p:---- s:1108 e:001107 CFUNC  :handle_interrupt 
c:0169 p:0026 2023-05-01T16:13:57.190173 : [c7a7f134-1038-4708-a74b-5642536cac26] Processing by REDACTED#REDACTED as V3 
s:1103 e:001102 BLOCK  /app/vendor/bundle/ruby/3.1.0/gems/activesupport-6.1.7.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25 [FINISH] 
c:0168 p:---- s:1100 e:001099 CFUNC  :handle_interrupt 
c:0167 p:0021 s:1095 e:001094 METHOD /app/vendor/bundle/ruby/3.1.0/gems/activesupport-6.1.7.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21 
c:0166 p:0006 s:1091 e:001090 METHOD /app/vendor/bundle/ruby/3.1.0/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/query_cache.rb:109 
c:0165 p:0056 s:1084 e:001083 METHOD /app/vendor/bundle/ruby/3.1.0/gems/activerecord-6.1.7.3/lib/active_record/connection_adapters/abstract/query_cache.rb:101 
c:0164 p:0024 s:1074 e:001073 BLOCK  /app/lib/freedom_patches/activerecord_calculation_logging.rb:20 
c:0163 p:0012 s:1071 e:001070 METHOD /app/vendor/bundle/ruby/3.1.0/gems/activerecord-6.1.7.3/lib/active_record/relation.rb:861 
c:0162 p:0089 s:1067 e:001066 METHOD /app/lib/freedom_patches/activerecord_calculation_logging.rb:20 
c:0161 p:0051 s:1060 e:001058 METHOD /app/app/components/conversations/collection_members_query.rb:195 
c:0160 p:0003 s:1055 e:001054 METHOD /app/app/components/conversations/collection_members_query.rb:200 
2023-05-01T16:13:57.190334 : [c7a7f134-1038-4708-a74b-5642536cac26] Parameters: {REDACTED} 
c:0159 p:0051 s:1050 e:001040 BLOCK  /app/app/components/conversations/collection_members_query.rb:28 [FINISH] 
c:0158 p:---- s:1037 e:001036 IFUNC  
c:0157 p:---- s:1034 e:001033 CFUNC  :each 
c:0156 p:0017 s:1030 e:001029 METHOD /app/vendor/bundle/ruby/3.1.0/gems/activerecord-6.1.7.3/lib/active_record/relation/delegation.rb:88 [FINISH] 
c:0155 p:---- s:1022 e:001021 CFUNC  :map 
c:0154 p:0013 s:1018 e:001017 METHOD /app/app/components/conversations/collection_members_query.rb:18 
c:0153 p:0003 s:1014 e:001013 METHOD /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/forwardable.rb:232 [FINISH] 
c:0152 p:---- s:1007 e:001006 CFUNC  :to_a 
c:0151 p:---- s:1004 e:001003 CFUNC  :Array 
c:0150 p:0007 s:0999 e:000998 METHOD /app/vendor/bundle/ruby/3.1.0/gems/dry-types-1.5.1/lib/dry/types/constructor/function.rb:72 
c:0149 p:0010 s:0992 e:000990 METHOD /app/vendor/bundle/ruby/3.1.0/gems/dry-types-1.5.1/lib/dry/types/constructor.rb:87 
c:0148 p:0031 s:0986 e:000985 METHOD /app/vendor/bundle/ruby/3.1.0/gems/dry-types-1.5.1/lib/dry/types/type.rb:49 
c:0147 p:0045 s:0980 e:000979 METHOD /app/lib/heracles/property.rb:36 
c:0146 p:0006 s:0972 e:000971 METHOD /app/lib/heracles/serializers/hydra.rb:25 
c:0145 p:0014 s:0965 e:000961 BLOCK  /app/lib/heracles/serializers/hydra.rb:18 [FINISH] 
c:0144 p:---- s:0957 e:000956 IFUNC  
c:0143 p:---- s:0954 e:000953 CFUNC  :each 
c:0142 p:---- s:0951 e:000950 CFUNC  :with_object 
c:0141 p:0044 s:0946 e:000945 METHOD /app/lib/heracles/serializers/hydra.rb:17 
c:0140 p:0027 s:0940 e:000939 METHOD /app/lib/heracles/resource.rb:74 
c:0139 p:0027 s:0934 e:000933 METHOD /app/app/shields/application_shield.rb:30 
c:0138 p:0015 s:0928 e:000926 BLOCK  /app/lib/heracles/railtie.rb:23 
c:0137 p:0033 s:0924 e:000923 METHOD /app/vendor/bundle/ruby/3.1.0/gems/activesupport-6.1.7.3/lib/active_support/notifications.rb:205 
c:0136 p:0123 s:0918 e:000917 BLOCK  /app/lib/heracles/railtie.rb:22 [FINISH] 
c:0135 p:0043 s:0909 e:000908 BLOCK  /app/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7.3/lib/action_controller/metal/renderers.rb:150 [FINISH] 
c:0134 p:---- s:0904 e:000903 CFUNC  :each_key 
c:0133 p:0022 s:0900 e:000899 METHOD /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/set.rb:511 
c:0132 p:0006 s:0895 E:001e28 METHOD /app/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7.3/lib/action_controller/metal/renderers.rb:146 
c:0131 p:0005 s:0890 e:000889 METHOD /app/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7.3/lib/action_controller/metal/renderers.rb:142 
c:0130 p:0018 s:0885 e:000884 METHOD /app/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7.3/lib/abstract_controller/rendering.rb:25 
c:0129 p:0033 s:0877 e:000876 METHOD /app/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7.3/lib/action_controller/metal/rendering.rb:36 
c:0128 p:0009 s:0872 e:000871 BLOCK  /app/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7.3/lib/action_controller/metal/instrumentation.rb:46 
c:0127 p:0028 s:0869 e:000868 METHOD /app/vendor/ruby-3.1.4/lib/ruby/3.1.0/benchmark.rb:311 
c:0126 p:0009 s:0864 e:000862 METHOD /app/vendor/bundle/ruby/3.1.0/gems/activesupport-6.1.7.3/lib/active_support/core_ext/benchmark.rb:14 
c:0125 p:0012 s:0858 e:000857 BLOCK  /app/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7.3/lib/action_controller/metal/instrumentation.rb:46 
c:0124 p:0002 s:0855 e:000854 METHOD /app/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7.3/lib/action_controller/metal/instrumentation.rb:86 
c:0123 p:0066 s:0851 e:000850 METHOD /app/vendor/bundle/ruby/3.1.0/gems/activerecord-6.1.7.3/lib/active_record/railties/controller_runtime.rb:34 
c:0122 p:0008 s:0844 e:000842 METHOD /app/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7.3/lib/action_controller/metal/instrumentation.rb:45 
c:0121 p:0066 s:0837 e:000836 METHOD /app/app/controllers/conversation_filters_controller.rb:32 
c:0120 p:0010 s:0832 e:000831 METHOD /app/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7.3/lib/action_controller/metal/basic_implicit_render.rb:6 
c:0119 p:0009 s:0826 e:000825 METHOD /app/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7.3/lib/abstract_controller/base.rb:228 
c:0118 p:0024 s:0820 e:000819 METHOD /app/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7.3/lib/action_controller/metal/rendering.rb:30 
c:0117 p:0008 s:0815 e:000814 BLOCK  /app/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7.3/lib/abstract_controller/callbacks.rb:42 
c:0116 p:0048 s:0812 e:000810 BLOCK  /app/vendor/bundle/ruby/3.1.0/gems/activesupport-6.1.7.3/lib/active_support/callbacks.rb:117 
c:0115 p:0037 s:0802 e:000801 METHOD /app/app/controllers/api_controller.rb:91 
c:0114 p:0127 s:0797 e:000796 BLOCK  /app/vendor/bundle/ruby/3.1.0/gems/activesupport-6.1.7.3/lib/active_support/callbacks.rb:126 
c:0113 p:0123 s:0788 E:002088 METHOD /app/vendor/bundle/ruby/3.1.0/gems/activesupport-6.1.7.3/lib/active_support/callbacks.rb:137 
c:0112 p:0006 s:0779 E:001388 METHOD /app/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7.3/lib/abstract_controller/callbacks.rb:41 
c:0111 p:0008 s:0774 e:000773 METHOD /app/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7.3/lib/action_controller/metal/rescue.rb:22 
c:0110 p:0009 s:0768 e:000767 BLOCK  /app/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7.3/lib/action_controller/metal/instrumentation.rb:34 
c:0109 p:0010 s:0763 e:000762 BLOCK  /app/vendor/bundle/ruby/3.1.0/gems/activesupport-6.1.7.3/lib/active_support/notifications.rb:203 
c:0108 p:0022 s:0760 e:000759 METHOD /app/vendor/bundle/ruby/3.1.0/gems/activesupport-6.1.7.3/lib/active_support/notifications/instrumenter.rb:24 
c:0107 p:0023 s:0752 e:000751 METHOD /app/vendor/bundle/ruby/3.1.0/gems/activesupport-6.1.7.3/lib/active_support/notifications.rb:203 
c:0106 p:0098 s:0746 e:000745 METHOD /app/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7.3/lib/action_controller/metal/instrumentation.rb:33 
c:0105 p:0017 s:0740 e:000739 METHOD /app/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7.3/lib/action_controller/metal/params_wrapper.rb:249 
c:0104 p:0026 s:0735 e:000734 METHOD /app/vendor/bundle/ruby/3.1.0/gems/activerecord-6.1.7.3/lib/active_record/railties/controller_runtime.rb:27 
c:0103 p:0070 s:0729 e:000728 METHOD /app/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7.3/lib/abstract_controller/base.rb:165 
c:0102 p:0067 s:0722 e:000721 METHOD /app/vendor/bundle/ruby/3.1.0/gems/actionview-6.1.7.3/lib/action_view/rendering.rb:39 
c:0101 p:0017 s:0716 e:000715 METHOD /app/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7.3/lib/action_controller/metal.rb:190 
c:0100 p:0177 s:0709 e:000708 METHOD /app/vendor/bundle/ruby/3.1.0/gems/opentelemetry-instrumentation-action_pack-0.6.0/lib/opentelemetry/instrumentation/action_pac 
c:0099 p:0033 s:0700 e:000699 METHOD /app/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7.3/lib/action_controller/metal.rb:254 
c:0098 p:0010 s:0693 e:000692 METHOD /app/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7.3/lib/action_dispatch/routing/route_set.rb:50 
c:0097 p:0036 s:0685 e:000684 METHOD /app/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7.3/lib/action_dispatch/routing/route_set.rb:33 
c:0096 p:0006 s:0677 e:000676 BLOCK  /app/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7.3/lib/action_dispatch/routing/mapper.rb:19 
c:0095 p:0026 s:0672 e:000671 METHOD /app/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7.3/lib/action_dispatch/routing/mapper.rb:49 
c:0094 p:0109 s:0667 e:000666 BLOCK  /app/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7.3/lib/action_dispatch/journey/router.rb:50 [FINISH] 
c:0093 p:---- s:0654 e:000653 CFUNC  :each 
c:0092 p:0008 s:0650 e:000649 METHOD /app/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7.3/lib/action_dispatch/journey/router.rb:32 
c:0091 p:0042 s:0645 e:000644 METHOD /app/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7.3/lib/action_dispatch/routing/route_set.rb:842 
c:0090 p:0185 s:0639 e:000638 METHOD /app/vendor/bundle/ruby/3.1.0/gems/rack-attack-6.6.1/lib/rack/attack.rb:127 
c:0089 p:0113 s:0633 e:000632 METHOD /app/vendor/bundle/ruby/3.1.0/gems/flipper-0.28.0/lib/flipper/middleware/memoizer.rb:72 
c:0088 p:0031 s:0626 e:000625 METHOD /app/vendor/bundle/ruby/3.1.0/gems/flipper-0.28.0/lib/flipper/middleware/memoizer.rb:37 
c:0087 p:0020 s:0620 e:000619 METHOD /app/vendor/bundle/ruby/3.1.0/gems/sidekiq-pro-4.0.5/lib/sidekiq/rack/batch_status.rb:34 
c:0086 p:0157 s:0613 e:000612 METHOD /app/vendor/bundle/ruby/3.1.0/gems/omniauth-2.0.4/lib/omniauth/strategy.rb:202 
c:0085 p:0007 s:0606 e:000605 METHOD /app/vendor/bundle/ruby/3.1.0/gems/omniauth-2.0.4/lib/omniauth/strategy.rb:169 
c:0084 p:0157 s:0601 e:000600 METHOD /app/vendor/bundle/ruby/3.1.0/gems/omniauth-2.0.4/lib/omniauth/strategy.rb:202 
c:0083 p:0007 s:0594 e:000593 METHOD /app/vendor/bundle/ruby/3.1.0/gems/omniauth-2.0.4/lib/omniauth/strategy.rb:169 
c:0082 p:0157 s:0589 e:000588 METHOD /app/vendor/bundle/ruby/3.1.0/gems/omniauth-2.0.4/lib/omniauth/strategy.rb:202 
c:0081 p:0007 s:0582 e:000581 METHOD /app/vendor/bundle/ruby/3.1.0/gems/omniauth-2.0.4/lib/omniauth/strategy.rb:169 
c:0080 p:0157 s:0577 e:000576 METHOD /app/vendor/bundle/ruby/3.1.0/gems/omniauth-2.0.4/lib/omniauth/strategy.rb:202 
c:0079 p:0007 s:0570 e:000569 METHOD /app/vendor/bundle/ruby/3.1.0/gems/omniauth-2.0.4/lib/omniauth/strategy.rb:169 
c:0078 p:0007 s:0565 e:000564 METHOD /app/vendor/bundle/ruby/3.1.0/gems/omniauth-2.0.4/lib/omniauth/builder.rb:45 
c:0077 p:0026 s:0560 e:000559 METHOD /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.7/lib/rack/session/abstract/id.rb:266 
c:0076 p:0005 s:0549 e:000548 METHOD /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.7/lib/rack/session/abstract/id.rb:260 
c:0075 p:0026 s:0544 e:000543 METHOD /app/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7.3/lib/action_dispatch/middleware/cookies.rb:697 
c:0074 p:0092 s:0534 e:000533 METHOD /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.7/lib/rack/method_override.rb:24 
c:0073 p:0035 s:0528 e:000527 METHOD /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.7/lib/rack/tempfile_reaper.rb:15 
c:0072 p:0007 s:0519 e:000518 METHOD /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.7/lib/rack/etag.rb:27 
c:0071 p:0050 s:0508 e:000507 METHOD /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.7/lib/rack/conditional_get.rb:27 
c:0070 p:0007 s:0499 e:000498 METHOD /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.7/lib/rack/head.rb:12 
c:0069 p:0026 s:0491 e:000490 METHOD /app/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7.3/lib/action_dispatch/http/permissions_policy.rb:22 
c:0068 p:0026 s:0481 e:000480 METHOD /app/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7.3/lib/action_dispatch/http/content_security_policy.rb:19 
c:0067 p:0026 s:0468 e:000467 METHOD /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.7/lib/rack/session/abstract/id.rb:266 
c:0066 p:0005 s:0457 e:000456 METHOD /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.7/lib/rack/session/abstract/id.rb:260 
c:0065 p:0026 s:0452 e:000451 METHOD /app/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7.3/lib/action_dispatch/middleware/cookies.rb:697 
c:0064 p:0008 s:0442 e:000441 BLOCK  /app/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7.3/lib/action_dispatch/middleware/callbacks.rb:27 
c:0063 p:0024 s:0439 e:000438 METHOD /app/vendor/bundle/ruby/3.1.0/gems/activesupport-6.1.7.3/lib/active_support/callbacks.rb:98 
c:0062 p:0009 s:0430 e:000429 METHOD /app/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7.3/lib/action_dispatch/middleware/callbacks.rb:26 
c:0061 p:0033 s:0423 e:000422 METHOD /app/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7.3/lib/action_dispatch/middleware/actionable_exceptions.rb:18 
c:0060 p:0026 s:0417 e:000416 METHOD /app/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7.3/lib/action_dispatch/middleware/debug_exceptions.rb:29 
c:0059 p:0026 s:0406 e:000405 METHOD /app/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7.3/lib/action_dispatch/middleware/show_exceptions.rb:33 
c:0058 p:0007 s:0399 e:000398 BLOCK  /app/vendor/cache/chewy-de4274461d1b/lib/chewy/railtie.rb:19 
c:0057 p:0009 s:0396 e:000395 METHOD /app/vendor/cache/chewy-de4274461d1b/lib/chewy/strategy.rb:70 
c:0056 p:0078 s:0390 e:000389 METHOD /app/vendor/cache/chewy-de4274461d1b/lib/chewy.rb:201 
c:0055 p:0157 s:0384 E:0015c8 METHOD /app/vendor/cache/chewy-de4274461d1b/lib/chewy/railtie.rb:19 
c:0054 p:0040 s:0379 e:000378 METHOD /app/vendor/bundle/ruby/3.1.0/gems/railties-6.1.7.3/lib/rails/rack/logger.rb:37 
c:0053 p:0007 s:0369 e:000368 BLOCK  /app/vendor/bundle/ruby/3.1.0/gems/railties-6.1.7.3/lib/rails/rack/logger.rb:26 
c:0052 p:0003 s:0366 e:000365 BLOCK  /app/vendor/bundle/ruby/3.1.0/gems/activesupport-6.1.7.3/lib/active_support/tagged_logging.rb:99 
c:0051 p:0012 s:0363 e:000362 METHOD /app/vendor/bundle/ruby/3.1.0/gems/activesupport-6.1.7.3/lib/active_support/tagged_logging.rb:37 
c:0050 p:0015 s:0357 e:000356 METHOD /app/vendor/bundle/ruby/3.1.0/gems/activesupport-6.1.7.3/lib/active_support/tagged_logging.rb:99 
c:0049 p:0039 s:0351 e:000350 METHOD /app/vendor/bundle/ruby/3.1.0/gems/railties-6.1.7.3/lib/rails/rack/logger.rb:26 
c:0048 p:0052 s:0345 e:000344 METHOD /app/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7.3/lib/action_dispatch/middleware/remote_ip.rb:81 
c:0047 p:0019 s:0339 e:000338 METHOD /app/vendor/bundle/ruby/3.1.0/gems/request_store-1.5.1/lib/request_store/middleware.rb:19 
c:0046 p:0008 s:0330 e:000329 BLOCK  /app/vendor/bundle/ruby/3.1.0/gems/rack-timeout-0.6.3/lib/rack/timeout/core.rb:148 
c:0045 p:0055 s:0326 E:002690 METHOD /app/vendor/bundle/ruby/3.1.0/gems/rack-timeout-0.6.3/lib/rack/timeout/support/timeout.rb:19 
c:0044 p:0425 s:0318 E:000d98 METHOD /app/vendor/bundle/ruby/3.1.0/gems/rack-timeout-0.6.3/lib/rack/timeout/core.rb:147 
c:0043 p:0043 s:0301 e:000300 METHOD /app/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7.3/lib/action_dispatch/middleware/request_id.rb:26 
c:0042 p:0092 s:0295 e:000294 METHOD /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.7/lib/rack/method_override.rb:24 
c:0041 p:0020 s:0289 e:000288 METHOD /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.7/lib/rack/runtime.rb:22 
c:0040 p:0033 s:0279 e:000278 METHOD /app/vendor/bundle/ruby/3.1.0/gems/activesupport-6.1.7.3/lib/active_support/cache/strategy/local_cache_middleware.rb:29 
c:0039 p:0016 s:0272 e:000271 METHOD /app/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7.3/lib/action_dispatch/middleware/executor.rb:14 
c:0038 p:0018 s:0264 e:000263 METHOD /app/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7.3/lib/action_dispatch/middleware/static.rb:24 
c:0037 p:0007 s:0259 e:000258 METHOD /app/lib/middleware/rack/add_connection_pool_context.rb:11 
c:0036 p:0007 s:0254 e:000253 METHOD /app/vendor/bundle/ruby/3.1.0/gems/rack-2.2.7/lib/rack/sendfile.rb:110 
c:0035 p:0234 s:0242 e:000241 METHOD /app/vendor/bundle/ruby/3.1.0/gems/rack-cors-1.1.1/lib/rack/cors.rb:100 
c:0034 p:0028 s:0228 e:000227 METHOD /app/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7.3/lib/action_dispatch/middleware/ssl.rb:77 
c:0033 p:0057 s:0222 e:000221 METHOD /app/vendor/bundle/ruby/3.1.0/gems/actionpack-6.1.7.3/lib/action_dispatch/middleware/host_authorization.rb:148 
c:0032 p:0017 s:0216 e:000215 BLOCK  /app/vendor/bundle/ruby/3.1.0/gems/honeybadger-5.2.1/lib/honeybadger/rack/error_notifier.rb:33 
c:0031 p:0010 s:0210 e:000209 METHOD /app/vendor/bundle/ruby/3.1.0/gems/honeybadger-5.2.1/lib/honeybadger/agent.rb:433 
c:0030 p:0008 s:0204 e:000203 METHOD /app/vendor/bundle/ruby/3.1.0/gems/honeybadger-5.2.1/lib/honeybadger/rack/error_notifier.rb:30 
c:0029 p:0024 s:0199 e:000198 METHOD /app/vendor/bundle/ruby/3.1.0/gems/honeybadger-5.2.1/lib/honeybadger/rack/user_feedback.rb:31 
c:0028 p:0024 s:0189 e:000188 METHOD /app/vendor/bundle/ruby/3.1.0/gems/honeybadger-5.2.1/lib/honeybadger/rack/user_informer.rb:21 
c:0027 p:0007 s:0179 e:000178 BLOCK  /app/lib/middleware/rack/tracing.rb:27 
c:0026 p:0022 s:0176 e:000175 METHOD /app/vendor/bundle/ruby/3.1.0/gems/opentelemetry-api-1.1.0/lib/opentelemetry/context.rb:104 
c:0025 p:0021 s:0169 e:000168 METHOD /app/app/components/operations/telemetry/tracer.rb:20 
c:0024 p:0087 s:0163 e:000162 METHOD /app/lib/middleware/rack/tracing.rb:26 
c:0023 p:0008 s:0156 e:000155 BLOCK  /app/vendor/bundle/ruby/3.1.0/gems/opentelemetry-instrumentation-rack-0.23.0/lib/opentelemetry/instrumentation/rack/middlewares 
c:0022 p:0006 s:0153 e:000152 BLOCK  /app/vendor/bundle/ruby/3.1.0/gems/opentelemetry-instrumentation-rack-0.23.0/lib/opentelemetry/instrumentation/rack.rb:45 
c:0021 p:0024 s:0148 e:000147 METHOD /app/vendor/bundle/ruby/3.1.0/gems/opentelemetry-api-1.1.0/lib/opentelemetry/context.rb:87 
c:0020 p:0023 s:0140 e:000139 METHOD /app/vendor/bundle/ruby/3.1.0/gems/opentelemetry-instrumentation-rack-0.23.0/lib/opentelemetry/instrumentation/rack.rb:45 
c:0019 p:0022 s:0135 e:000134 BLOCK  /app/vendor/bundle/ruby/3.1.0/gems/opentelemetry-instrumentation-rack-0.23.0/lib/opentelemetry/instrumentation/rack/middlewares 
c:0018 p:0006 s:0131 e:000130 BLOCK  /app/vendor/bundle/ruby/3.1.0/gems/opentelemetry-api-1.1.0/lib/opentelemetry/trace.rb:72 
c:0017 p:0024 s:0126 e:000125 METHOD /app/vendor/bundle/ruby/3.1.0/gems/opentelemetry-api-1.1.0/lib/opentelemetry/context.rb:87 
c:0016 p:0023 s:0118 e:000117 METHOD /app/vendor/bundle/ruby/3.1.0/gems/opentelemetry-api-1.1.0/lib/opentelemetry/trace.rb:72 
c:0015 p:0035 s:0113 e:000112 METHOD /app/vendor/bundle/ruby/3.1.0/gems/opentelemetry-api-1.1.0/lib/opentelemetry/trace/tracer.rb:29 
c:0014 p:0053 s:0100 e:000099 BLOCK  /app/vendor/bundle/ruby/3.1.0/gems/opentelemetry-instrumentation-rack-0.23.0/lib/opentelemetry/instrumentation/rack/middlewares 
c:0013 p:0011 s:0095 e:000094 METHOD /app/vendor/bundle/ruby/3.1.0/gems/opentelemetry-api-1.1.0/lib/opentelemetry/context.rb:71 
c:0012 p:0103 s:0089 e:000088 METHOD /app/vendor/bundle/ruby/3.1.0/gems/opentelemetry-instrumentation-rack-0.23.0/lib/opentelemetry/instrumentation/rack/middlewares 
c:0011 p:0047 s:0081 e:000080 METHOD /app/vendor/bundle/ruby/3.1.0/gems/hirefire-resource-0.10.1/lib/hirefire/middleware.rb:37 
c:0010 p:0016 s:0076 e:000075 METHOD /app/vendor/bundle/ruby/3.1.0/gems/railties-6.1.7.3/lib/rails/engine.rb:539 
c:0009 p:0028 s:0070 e:000069 METHOD /app/vendor/bundle/ruby/3.1.0/gems/puma-5.6.5/lib/puma/configuration.rb:252 
c:0008 p:0007 s:0065 e:000064 BLOCK  /app/vendor/bundle/ruby/3.1.0/gems/puma-5.6.5/lib/puma/request.rb:77 
c:0007 p:0022 s:0062 e:000061 METHOD /app/vendor/bundle/ruby/3.1.0/gems/puma-5.6.5/lib/puma/thread_pool.rb:340 
c:0006 p:0285 s:0057 e:000056 METHOD /app/vendor/bundle/ruby/3.1.0/gems/puma-5.6.5/lib/puma/request.rb:76 
c:0005 p:0111 s:0036 e:000035 METHOD /app/vendor/bundle/ruby/3.1.0/gems/puma-5.6.5/lib/puma/server.rb:443 [FINISH] 
c:0004 p:---- s:0024 e:000023 IFUNC  
c:0003 p:0097 s:0021 e:000018 BLOCK  /app/vendor/bundle/ruby/3.1.0/gems/puma-5.6.5/lib/puma/thread_pool.rb:147 
c:0002 p:0045 s:0007 e:000006 BLOCK  /app/vendor/bundle/ruby/3.1.0/gems/logging-2.3.1/lib/logging/diagnostic_context.rb:474 [FINISH] 
c:0001 p:---- s:0003 e:000002 (none) [FINISH] 
-- Ruby level backtrace information ---------------------------------------- 
-- Machine register context ------------------------------------------------ 
 RIP: 0x00007f86a67715ab RBP: 0x00007f869a2eaf80 RSP: 0x00007f869d5e6600 
 RAX: 0x0000000000000004 RBX: 0x0000000000000000 RCX: 0x000000000000009e 
 RDX: 0x0000000000000130 RDI: 0x000055e53afc0040 RSI: 0x0000000000000030 
  R8: 0x0000000000000001  R9: 0x0000000000000020 R10: 0x0000000000000028 
 R11: 0x0000000000000028 R12: 0x000055e53afc0040 R13: 0x000000000000000c 
 R14: 0x000055e53afc0080 R15: 0x00007f8693ad0608 EFL: 0x0000000000010206 
-- C level backtrace information ------------------------------------------- 
@zacheryph zacheryph added the bug Something isn't working label May 1, 2023
@arielvalentin
Copy link
Collaborator

Thanks for opening this issue.

This is our first report of an issue with this patch causing segfaults, the patches are written in Ruby and do not change any of the underlying native extensions so I am surprised to see you all are experiencing this.

Would you be able to disable the instrumentation to confirm the issue is not related to concurrent access of DB connections? ged/ruby-pg#493

@zacheryph
Copy link
Contributor Author

We're running pg 1.5.2. I kind of figured the wrappers we're pretty simple and odd to be sprouting this kind of issue.

I will look into disabling this temporarily. Might take a few days to get back / verify the issue persists or goes away.

@arielvalentin
Copy link
Collaborator

Thank you. If you have the ability to updating environment variables without requiring code changes, you may consider setting OTEL_RUBY_INSTRUMENTATION_PG_ENABLED to false. The instrumentation will then skip installation when your application picks up the envar changes.

@larskanis
Copy link

pg-1.5.3 fixes a possible segfault in PG::Connection#exec* methods, when using a type map like rails does. Is it still happening with pg-1.5.3?

@zacheryph
Copy link
Contributor Author

We upgraded this for other reasons but this appears to be resolved. Thank you.

@Amnesthesia
Copy link

pg-1.5.3 fixes a possible segfault in PG::Connection#exec* methods, when using a type map like rails does. Is it still happening with pg-1.5.3?

Experiencing this with 1.5.3

/Users/victor/.rvm/gems/ruby-3.2.2/gems/pg-1.5.3/lib/pg/connection.rb:690: [BUG] Segmentation fault at 0x00000001054b0aa6

@larskanis
Copy link

@Amnesthesia your segfault happens in a different line of code. It's probably this issue in Macos: ged/ruby-pg#538

@Amnesthesia
Copy link

@larskanis Turned out to be libpq not being installed and my pg being built against postgres 13, using Postgres.app with postgres 13, and then having updated brew and having the CLI for postgres 14.8 installed.

Solved by uninstalling pg gem, installing libpq and compiling pg gem with --with-pg-config=... and pointing to the correct version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants