k0kubun / hamlit

High Performance Haml Implementation
https://rubygems.org/gems/hamlit
Other
981 stars 59 forks source link

Possible MRI/Hamlit C crash from `escape_attribute` #157

Closed brodock closed 4 years ago

brodock commented 4 years ago

I got a stacktrace from our CI today, that failed in a hamlit parsed file. It seems to point to https://github.com/k0kubun/hamlit/blob/master/ext/hamlit/hamlit.c#L158

the relevant bits:

/builds/gitlab-org/gitlab/app/views/projects/new.html.haml:53: [BUG] Segmentation fault at 0x0000000000000038
ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-linux]

-- Control frame information -----------------------------------------------
c:0211 p:---- s:1376 e:001375 CFUNC  :build_class
c:0210 p:1228 s:1369 E:000480 METHOD /builds/gitlab-org/gitlab/app/views/projects/new.html.haml:53
c:0209 p:0039 s:1328 e:001327 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionview-6.0.2/lib/action_view/base.rb:274
c:0208 p:0026 s:1316 e:001315 BLOCK  /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionview-6.0.2/lib/action_view/template.rb:185
c:0207 p:0039 s:1313 e:001312 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/activesupport-6.0.2/lib/active_support/notifications.rb:182
c:0206 p:0022 s:1307 e:001306 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionview-6.0.2/lib/action_view/template.rb:386
c:0205 p:0019 s:1302 e:001301 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionview-6.0.2/lib/action_view/template.rb:183
c:0204 p:0014 s:1293 E:000310 BLOCK  /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionview-6.0.2/lib/action_view/renderer/template_renderer.rb:59
c:0203 p:0005 s:1290 e:001289 BLOCK  /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionview-6.0.2/lib/action_view/renderer/abstract_renderer.rb:89
c:0202 p:0011 s:1286 e:001285 BLOCK  /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/activesupport-6.0.2/lib/active_support/notifications.rb:180
c:0201 p:0024 s:1283 e:001282 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/activesupport-6.0.2/lib/active_support/notifications/instrumenter.rb:24
c:0200 p:0027 s:1275 e:001274 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/activesupport-6.0.2/lib/active_support/notifications.rb:180
c:0199 p:0035 s:1269 e:001268 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionview-6.0.2/lib/action_view/renderer/abstract_renderer.rb:88
c:0198 p:0020 s:1263 E:002028 BLOCK  /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionview-6.0.2/lib/action_view/renderer/template_renderer.rb:58
c:0197 p:0032 s:1259 e:001258 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionview-6.0.2/lib/action_view/renderer/template_renderer.rb:66
c:0196 p:0013 s:1248 E:0002e0 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionview-6.0.2/lib/action_view/renderer/template_renderer.rb:57
c:0195 p:0055 s:1240 e:001239 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionview-6.0.2/lib/action_view/renderer/template_renderer.rb:13
c:0194 p:0020 s:1233 e:001232 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionview-6.0.2/lib/action_view/renderer/renderer.rb:61
c:0193 p:0026 s:1227 e:001226 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionview-6.0.2/lib/action_view/renderer/renderer.rb:29
c:0192 p:0010 s:1221 e:001220 BLOCK  /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionview-6.0.2/lib/action_view/rendering.rb:118
c:0191 p:0096 s:1217 e:001216 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionview-6.0.2/lib/action_view/base.rb:304
c:0190 p:0058 s:1209 e:001208 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionview-6.0.2/lib/action_view/rendering.rb:117
c:0189 p:0044 s:1199 e:001198 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionpack-6.0.2/lib/action_controller/metal/streaming.rb:219
c:0188 p:0017 s:1194 e:001193 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionview-6.0.2/lib/action_view/rendering.rb:103
c:0187 p:0011 s:1189 e:001188 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionpack-6.0.2/lib/action_controller/metal/rendering.rb:52
c:0186 p:0017 s:1184 e:001183 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionpack-6.0.2/lib/action_controller/metal/renderers.rb:142
c:0185 p:0020 s:1179 e:001178 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionpack-6.0.2/lib/abstract_controller/rendering.rb:25
c:0184 p:0032 s:1171 e:001170 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionpack-6.0.2/lib/action_controller/metal/rendering.rb:36
c:0183 p:0011 s:1166 e:001165 BLOCK  /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionpack-6.0.2/lib/action_controller/metal/instrumentation.rb:44
c:0182 p:0003 s:1163 e:001162 BLOCK  /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/activesupport-6.0.2/lib/active_support/core_ext/benchmark.rb:14
c:0181 p:0023 s:1160 e:001159 METHOD /usr/local/lib/ruby/2.6.0/benchmark.rb:308
c:0180 p:0007 s:1155 e:001153 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/activesupport-6.0.2/lib/active_support/core_ext/benchmark.rb:14
c:0179 p:0012 s:1150 e:001149 BLOCK  /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionpack-6.0.2/lib/action_controller/metal/instrumentation.rb:44
c:0178 p:0002 s:1147 e:001146 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionpack-6.0.2/lib/action_controller/metal/instrumentation.rb:85
c:0177 p:0110 s:1143 e:001142 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/activerecord-6.0.2/lib/active_record/railties/controller_runtime.rb:39
c:0176 p:0023 s:1136 e:001135 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/elasticsearch-rails-6.1.0/lib/elasticsearch/rails/instrumentation/controller_r
c:0175 p:0009 s:1129 e:001127 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionpack-6.0.2/lib/action_controller/metal/instrumentation.rb:43
c:0174 p:0009 s:1122 e:001121 METHOD /builds/gitlab-org/gitlab/app/controllers/application_controller.rb:125
c:0173 p:0028 s:1117 e:001116 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionpack-6.0.2/lib/action_controller/metal/implicit_render.rb:35
c:0172 p:0013 s:1112 e:001111 BLOCK  /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionpack-6.0.2/lib/action_controller/metal/basic_implicit_render.rb:6 [FINISH]
c:0171 p:---- s:1109 e:001108 CFUNC  :tap
c:0170 p:0015 s:1105 e:001104 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionpack-6.0.2/lib/action_controller/metal/basic_implicit_render.rb:6
c:0169 p:0010 s:1099 e:001098 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionpack-6.0.2/lib/abstract_controller/base.rb:196
c:0168 p:0030 s:1093 e:001092 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionpack-6.0.2/lib/action_controller/metal/rendering.rb:30
c:0167 p:0010 s:1088 e:001087 BLOCK  /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionpack-6.0.2/lib/abstract_controller/callbacks.rb:42
c:0166 p:0054 s:1085 e:001083 BLOCK  /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/activesupport-6.0.2/lib/active_support/callbacks.rb:112
c:0165 p:0009 s:1075 e:001074 METHOD /builds/gitlab-org/gitlab/ee/lib/gitlab/ip_address_state.rb:10
c:0164 p:0026 s:1070 e:001069 METHOD /builds/gitlab-org/gitlab/ee/app/controllers/ee/application_controller.rb:43
c:0163 p:0140 s:1065 e:001064 BLOCK  /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/activesupport-6.0.2/lib/active_support/callbacks.rb:121
c:0162 p:0092 s:1056 e:001055 METHOD /builds/gitlab-org/gitlab/lib/gitlab/auth/current_user_mode.rb:62
c:0161 p:0048 s:1051 e:001050 METHOD /builds/gitlab-org/gitlab/app/controllers/application_controller.rb:482
c:0160 p:0140 s:1046 e:001045 BLOCK  /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/activesupport-6.0.2/lib/active_support/callbacks.rb:121
c:0159 p:0015 s:1037 e:001036 METHOD /builds/gitlab-org/gitlab/lib/gitlab/session.rb:11
c:0158 p:0029 s:1031 e:001030 METHOD /builds/gitlab-org/gitlab/app/controllers/application_controller.rb:470
c:0157 p:0140 s:1026 e:001025 BLOCK  /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/activesupport-6.0.2/lib/active_support/callbacks.rb:121
c:0156 p:0015 s:1017 e:001016 METHOD /builds/gitlab-org/gitlab/lib/gitlab/i18n.rb:55
c:0155 p:0016 s:1011 e:001010 METHOD /builds/gitlab-org/gitlab/lib/gitlab/i18n.rb:61
c:0154 p:0020 s:1005 e:001004 METHOD /builds/gitlab-org/gitlab/app/controllers/application_controller.rb:464
c:0153 p:0140 s:1000 e:000999 BLOCK  /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/activesupport-6.0.2/lib/active_support/callbacks.rb:121
c:0152 p:0085 s:0991 e:000990 METHOD /builds/gitlab-org/gitlab/lib/gitlab/error_tracking.rb:34
c:0151 p:0020 s:0984 e:000983 METHOD /builds/gitlab-org/gitlab/app/controllers/application_controller.rb:555
c:0150 p:0140 s:0979 e:000978 BLOCK  /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/activesupport-6.0.2/lib/active_support/callbacks.rb:121
c:0149 p:0057 s:0970 e:000969 BLOCK  /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/sentry-raven-2.9.0/lib/raven/integrations/rails/controller_transaction.rb:7 [FINISH]
c:0148 p:---- s:0965 e:000964 CFUNC  :instance_exec
c:0147 p:0140 s:0959 e:000958 BLOCK  /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/activesupport-6.0.2/lib/active_support/callbacks.rb:121
c:0146 p:0016 s:0950 e:000949 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/marginalia-1.8.0/lib/marginalia.rb:111
c:0145 p:0140 s:0946 e:000945 BLOCK  /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/activesupport-6.0.2/lib/active_support/callbacks.rb:121
c:0144 p:0003 s:0937 e:000936 BLOCK  /builds/gitlab-org/gitlab/lib/gitlab/application_context.rb:48
c:0143 p:0016 s:0934 e:000933 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/gitlab-labkit-0.12.0/lib/labkit/context.rb:32
c:0142 p:0017 s:0928 e:000927 METHOD /builds/gitlab-org/gitlab/lib/gitlab/application_context.rb:48
c:0141 p:0024 s:0924 e:000923 METHOD /builds/gitlab-org/gitlab/lib/gitlab/application_context.rb:20
c:0140 p:0038 s:0917 E:001a48 METHOD /builds/gitlab-org/gitlab/app/controllers/application_controller.rb:455
c:0139 p:0140 s:0912 e:000911 BLOCK  /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/activesupport-6.0.2/lib/active_support/callbacks.rb:121
c:0138 p:0136 s:0903 E:0017b8 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/activesupport-6.0.2/lib/active_support/callbacks.rb:139
c:0137 p:0007 s:0894 E:001598 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionpack-6.0.2/lib/abstract_controller/callbacks.rb:41
c:0136 p:0009 s:0889 e:000888 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionpack-6.0.2/lib/action_controller/metal/rescue.rb:22
c:0135 p:0010 s:0883 e:000882 BLOCK  /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionpack-6.0.2/lib/action_controller/metal/instrumentation.rb:33
c:0134 p:0011 s:0879 e:000878 BLOCK  /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/activesupport-6.0.2/lib/active_support/notifications.rb:180
c:0133 p:0024 s:0876 e:000875 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/activesupport-6.0.2/lib/active_support/notifications/instrumenter.rb:24
c:0132 p:0027 s:0868 e:000867 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/activesupport-6.0.2/lib/active_support/notifications.rb:180
c:0131 p:0104 s:0862 e:000861 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionpack-6.0.2/lib/action_controller/metal/instrumentation.rb:32
c:0130 p:0020 s:0856 e:000855 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionpack-6.0.2/lib/action_controller/metal/params_wrapper.rb:245
c:0129 p:0024 s:0851 e:000850 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/activerecord-6.0.2/lib/active_record/railties/controller_runtime.rb:27
c:0128 p:0083 s:0845 e:000844 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionpack-6.0.2/lib/abstract_controller/base.rb:136
c:0127 p:0060 s:0838 e:000837 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionview-6.0.2/lib/action_view/rendering.rb:39
c:0126 p:0020 s:0832 e:000831 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionpack-6.0.2/lib/action_controller/metal.rb:191
c:0125 p:0042 s:0825 e:000824 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionpack-6.0.2/lib/action_controller/metal.rb:252
c:0124 p:0011 s:0818 e:000817 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionpack-6.0.2/lib/action_dispatch/routing/route_set.rb:51
c:0123 p:0041 s:0810 e:000809 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionpack-6.0.2/lib/action_dispatch/routing/route_set.rb:33
c:0122 p:0135 s:0802 e:000801 BLOCK  /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionpack-6.0.2/lib/action_dispatch/journey/router.rb:49 [FINISH]
c:0121 p:---- s:0790 e:000789 CFUNC  :each
c:0120 p:0010 s:0786 e:000785 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionpack-6.0.2/lib/action_dispatch/journey/router.rb:32
c:0119 p:0041 s:0781 e:000780 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionpack-6.0.2/lib/action_dispatch/routing/route_set.rb:837
c:0118 p:0013 s:0775 e:000774 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:420
c:0117 p:0057 s:0770 e:000769 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:274
c:0116 p:0072 s:0765 e:000764 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:186
c:0115 p:0009 s:0759 e:000758 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:169
c:0114 p:0013 s:0754 e:000753 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:420
c:0113 p:0057 s:0749 e:000748 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:274
c:0112 p:0072 s:0744 e:000743 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:186
c:0111 p:0009 s:0738 e:000737 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:169
c:0110 p:0013 s:0733 e:000732 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:420
c:0109 p:0057 s:0728 e:000727 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:274
c:0108 p:0072 s:0723 e:000722 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:186
c:0107 p:0009 s:0717 e:000716 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:169
c:0106 p:0013 s:0712 e:000711 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:420
c:0105 p:0057 s:0707 e:000706 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:274
c:0104 p:0072 s:0702 e:000701 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:186
c:0103 p:0009 s:0696 e:000695 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:169
c:0102 p:0013 s:0691 e:000690 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:420
c:0101 p:0057 s:0686 e:000685 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:274
c:0100 p:0072 s:0681 e:000680 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:186
c:0099 p:0009 s:0675 e:000674 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:169
c:0098 p:0013 s:0670 e:000669 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:420
c:0097 p:0057 s:0665 e:000664 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:274
c:0096 p:0072 s:0660 e:000659 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:186
c:0095 p:0009 s:0654 e:000653 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:169
c:0094 p:0013 s:0649 e:000648 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:420
c:0093 p:0057 s:0644 e:000643 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:274
c:0092 p:0072 s:0639 e:000638 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:186
c:0091 p:0009 s:0633 e:000632 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:169
c:0090 p:0013 s:0628 e:000627 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:420
c:0089 p:0057 s:0623 e:000622 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:274
c:0088 p:0072 s:0618 e:000617 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:186
c:0087 p:0009 s:0612 e:000611 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:169
c:0086 p:0013 s:0607 e:000606 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:420
c:0085 p:0057 s:0602 e:000601 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:274
c:0084 p:0072 s:0597 e:000596 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:186
c:0083 p:0009 s:0591 e:000590 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:169
c:0082 p:0013 s:0586 e:000585 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:420
c:0081 p:0057 s:0581 e:000580 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:274
c:0080 p:0072 s:0576 e:000575 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:186
c:0079 p:0009 s:0570 e:000569 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:169
c:0078 p:0013 s:0565 e:000564 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:420
c:0077 p:0057 s:0560 e:000559 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:274
c:0076 p:0072 s:0555 e:000554 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:186
c:0075 p:0009 s:0549 e:000548 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:169
c:0074 p:0013 s:0544 e:000543 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:420
c:0073 p:0057 s:0539 e:000538 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:274
c:0072 p:0072 s:0534 e:000533 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:186
c:0071 p:0009 s:0528 e:000527 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/omniauth-1.9.0/lib/omniauth/strategy.rb:169
c:0070 p:0023 s:0523 e:000522 METHOD /builds/gitlab-org/gitlab/lib/gitlab/request_profiler/middleware.rb:17
c:0069 p:0009 s:0518 e:000517 BLOCK  /builds/gitlab-org/gitlab/lib/gitlab/query_limiting/middleware.rb:17
c:0068 p:0033 s:0515 e:000513 METHOD /builds/gitlab-org/gitlab/lib/gitlab/query_limiting/transaction.rb:39
c:0067 p:0011 s:0509 e:000508 METHOD /builds/gitlab-org/gitlab/lib/gitlab/query_limiting/middleware.rb:16
c:0066 p:0009 s:0502 e:000501 BLOCK  /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/gitlab-labkit-0.12.0/lib/labkit/middleware/rack.rb:19
c:0065 p:0016 s:0499 e:000498 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/gitlab-labkit-0.12.0/lib/labkit/context.rb:32
c:0064 p:0032 s:0493 e:000492 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/gitlab-labkit-0.12.0/lib/labkit/middleware/rack.rb:18
c:0063 p:0044 s:0488 e:000487 METHOD /builds/gitlab-org/gitlab/ee/lib/gitlab/jira/middleware.rb:19
c:0062 p:0034 s:0483 e:000482 METHOD /builds/gitlab-org/gitlab/lib/gitlab/middleware/go.rb:20
c:0061 p:0049 s:0477 e:000476 METHOD /builds/gitlab-org/gitlab/lib/gitlab/etag_caching/middleware.rb:13
c:0060 p:0008 s:0464 e:000463 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/batch-loader-1.4.0/lib/batch_loader/middleware.rb:11
c:0059 p:0100 s:0459 e:000458 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/apollo_upload_server-2.0.0.beta.3/lib/apollo_upload_server/middleware.rb:20
c:0058 p:0029 s:0451 e:000450 METHOD /builds/gitlab-org/gitlab/lib/gitlab/middleware/multipart.rb:121
c:0057 p:0135 s:0444 e:000443 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/rack-attack-6.2.0/lib/rack/attack.rb:169
c:0056 p:0020 s:0438 e:000437 BLOCK  /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/warden-1.2.8/lib/warden/manager.rb:36 [FINISH]
c:0055 p:---- s:0435 e:000434 CFUNC  :catch
c:0054 p:0064 s:0430 e:000429 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/warden-1.2.8/lib/warden/manager.rb:34
c:0053 p:0204 s:0424 e:000423 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/rack-cors-1.0.6/lib/rack/cors.rb:98
c:0052 p:0036 s:0410 e:000409 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/rack-2.0.7/lib/rack/tempfile_reaper.rb:15
c:0051 p:0008 s:0401 e:000400 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/rack-2.0.7/lib/rack/etag.rb:25
c:0050 p:0049 s:0390 e:000389 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/rack-2.0.7/lib/rack/conditional_get.rb:25
c:0049 p:0008 s:0381 e:000380 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/rack-2.0.7/lib/rack/head.rb:12
c:0048 p:0024 s:0373 e:000372 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionpack-6.0.2/lib/action_dispatch/http/content_security_policy.rb:18
c:0047 p:0132 s:0360 e:000359 METHOD /builds/gitlab-org/gitlab/lib/gitlab/middleware/read_only/controller.rb:53
c:0046 p:0027 s:0356 e:000355 METHOD /builds/gitlab-org/gitlab/lib/gitlab/middleware/read_only.rb:18
c:0045 p:0030 s:0351 e:000350 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/rack-2.0.7/lib/rack/session/abstract/id.rb:232
c:0044 p:0006 s:0340 e:000339 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/rack-2.0.7/lib/rack/session/abstract/id.rb:226
c:0043 p:0024 s:0335 e:000334 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionpack-6.0.2/lib/action_dispatch/middleware/cookies.rb:648
c:0042 p:0008 s:0325 e:000324 METHOD /builds/gitlab-org/gitlab/lib/gitlab/middleware/same_site_cookies.rb:27
c:0041 p:0009 s:0314 e:000313 BLOCK  /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionpack-6.0.2/lib/action_dispatch/middleware/callbacks.rb:27
c:0040 p:0029 s:0311 e:000310 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/activesupport-6.0.2/lib/active_support/callbacks.rb:101
c:0039 p:0010 s:0302 e:000301 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionpack-6.0.2/lib/action_dispatch/middleware/callbacks.rb:26
c:0038 p:0032 s:0295 e:000294 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionpack-6.0.2/lib/action_dispatch/middleware/actionable_exceptions.rb:17
c:0037 p:0024 s:0289 e:000288 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionpack-6.0.2/lib/action_dispatch/middleware/debug_exceptions.rb:32
c:0036 p:0024 s:0278 e:000277 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionpack-6.0.2/lib/action_dispatch/middleware/show_exceptions.rb:33
c:0035 p:0027 s:0271 e:000270 METHOD /builds/gitlab-org/gitlab/lib/gitlab/middleware/basic_health_check.rb:25
c:0034 p:0042 s:0265 e:000264 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/railties-6.0.2/lib/rails/rack/logger.rb:38
c:0033 p:0009 s:0255 e:000254 BLOCK  /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/railties-6.0.2/lib/rails/rack/logger.rb:26
c:0032 p:0004 s:0252 e:000251 BLOCK  /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/activesupport-6.0.2/lib/active_support/tagged_logging.rb:80
c:0031 p:0013 s:0249 e:000248 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/activesupport-6.0.2/lib/active_support/tagged_logging.rb:28
c:0030 p:0012 s:0243 e:000242 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/activesupport-6.0.2/lib/active_support/tagged_logging.rb:80
c:0029 p:0041 s:0238 e:000237 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/railties-6.0.2/lib/rails/rack/logger.rb:26
c:0028 p:0053 s:0232 e:000231 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionpack-6.0.2/lib/action_dispatch/middleware/remote_ip.rb:81
c:0027 p:0105 s:0226 e:000225 METHOD /builds/gitlab-org/gitlab/lib/gitlab/middleware/request_context.rb:23
c:0026 p:0019 s:0220 e:000219 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/request_store-1.3.1/lib/request_store/middleware.rb:9
c:0025 p:0039 s:0215 e:000214 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionpack-6.0.2/lib/action_dispatch/middleware/request_id.rb:27
c:0024 p:0091 s:0209 e:000208 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/rack-2.0.7/lib/rack/method_override.rb:22
c:0023 p:0020 s:0203 e:000202 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/rack-2.0.7/lib/rack/runtime.rb:22
c:0022 p:0033 s:0193 e:000192 METHOD /builds/gitlab-org/gitlab/config/initializers/fix_local_cache_middleware.rb:9
c:0021 p:0016 s:0186 e:000185 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionpack-6.0.2/lib/action_dispatch/middleware/executor.rb:14
c:0020 p:0083 s:0178 e:000177 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionpack-6.0.2/lib/action_dispatch/middleware/static.rb:126
c:0019 p:0035 s:0170 e:000169 METHOD /builds/gitlab-org/gitlab/lib/gitlab/middleware/static.rb:11
c:0018 p:0024 s:0165 e:000164 METHOD /builds/gitlab-org/gitlab/lib/gitlab/testing/clear_thread_memory_cache_middleware.rb:13
c:0017 p:0015 s:0160 e:000159 METHOD /builds/gitlab-org/gitlab/lib/gitlab/testing/request_inspector_middleware.rb:33
c:0016 p:0040 s:0148 e:000147 METHOD /builds/gitlab-org/gitlab/lib/gitlab/testing/request_blocker_middleware.rb:47
c:0015 p:0008 s:0143 e:000142 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/rack-2.0.7/lib/rack/sendfile.rb:111
c:0014 p:0051 s:0131 e:000130 METHOD /builds/gitlab-org/gitlab/lib/gitlab/metrics/requests_rack_middleware.rb:49
c:0013 p:0016 s:0120 e:000119 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/actionpack-6.0.2/lib/action_dispatch/middleware/host_authorization.rb:77
c:0012 p:0069 s:0114 e:000113 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/sentry-raven-2.9.0/lib/raven/integrations/rack.rb:51
c:0011 p:0020 s:0106 e:000105 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/railties-6.0.2/lib/rails/engine.rb:526
c:0010 p:0130 s:0100 e:000099 BLOCK  /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/rack-2.0.7/lib/rack/urlmap.rb:68 [FINISH]
c:0009 p:---- s:0091 e:000090 CFUNC  :each
c:0008 p:0125 s:0087 e:000086 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/rack-2.0.7/lib/rack/urlmap.rb:53
c:0007 p:0047 s:0076 e:000075 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/capybara-3.22.0/lib/capybara/server/middleware.rb:48
c:0006 p:0026 s:0070 e:000069 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/gitlab-puma-4.3.3.gitlab.2/lib/puma/configuration.rb:228
c:0005 p:0263 s:0065 e:000064 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/gitlab-puma-4.3.3.gitlab.2/lib/puma/server.rb:691
c:0004 p:0029 s:0040 e:000039 METHOD /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/gitlab-puma-4.3.3.gitlab.2/lib/puma/server.rb:481
c:0003 p:0065 s:0026 e:000025 BLOCK  /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/gitlab-puma-4.3.3.gitlab.2/lib/puma/server.rb:335
c:0002 p:0107 s:0016 e:000015 BLOCK  /builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/gitlab-puma-4.3.3.gitlab.2/lib/puma/thread_pool.rb:138 [FINISH]
c:0001 p:---- s:0003 e:000002 (none) [FINISH]
...
-- C level backtrace information -------------------------------------------
/usr/local/lib/libruby.so.2.6(rb_vm_bugreport+0x4f1) [0x7f779df18dd1] vm_dump.c:715
/usr/local/lib/libruby.so.2.6(rb_bug_context+0xe7) [0x7f779dd699a7] error.c:609
/usr/local/lib/libruby.so.2.6(sigsegv+0x42) [0x7f779de82252] signal.c:998
/lib/x86_64-linux-gnu/libpthread.so.0(__restore_rt+0x0) [0x7f779d8890e0]
/usr/local/lib/libruby.so.2.6(method_entry_get+0x144) [0x7f779def5834] vm_method.c:813
/usr/local/lib/libruby.so.2.6(vm_respond_to+0x3f) [0x7f779df01dcf] vm_method.c:1990
/usr/local/lib/libruby.so.2.6(rb_check_funcall_default+0x49) [0x7f779df02019] vm_eval.c:358
/usr/local/lib/libruby.so.2.6(rb_check_convert_type_with_id+0x4f) [0x7f779ddfe24f] object.c:2943
/usr/local/lib/libruby.so.2.6(rb_ary_join+0xef) [0x7f779dcf129f] array.c:2315
/builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/hamlit-2.11.0/lib/hamlit/hamlit.so(hamlit_build_class+0xd9) [0x7f77901d6349] hamlit.c:158
/usr/local/lib/libruby.so.2.6(vm_call_cfunc+0x10f) [0x7f779def8bff] vm_insnhelper.c:1908
/usr/local/lib/libruby.so.2.6(vm_exec_core+0x15a) [0x7f779df0230a] insns.def:765
/usr/local/lib/libruby.so.2.6(rb_vm_exec+0x7ff) [0x7f779df090ef] vm.c:1894
/usr/local/lib/libruby.so.2.6(rb_yield+0x18c) [0x7f779df0959c] vm.c:1092
/usr/local/lib/libruby.so.2.6(rb_obj_tap+0x9) [0x7f779ddf98a9] object.c:910
/usr/local/lib/libruby.so.2.6(vm_call_cfunc+0x10f) [0x7f779def8bff] vm_insnhelper.c:1908
/usr/local/lib/libruby.so.2.6(vm_call_method+0xf3) [0x7f779df0c943] vm_insnhelper.c:2400
/usr/local/lib/libruby.so.2.6(vm_exec_core+0xa1c) [0x7f779df02bcc] insns.def:750
/usr/local/lib/libruby.so.2.6(rb_vm_exec+0x7ff) [0x7f779df090ef] vm.c:1894
/usr/local/lib/libruby.so.2.6(invoke_block_from_c_bh+0x1fb) [0x7f779df09a9b] vm.c:1092
/usr/local/lib/libruby.so.2.6(yield_under+0x1d8) [0x7f779df09db8] vm.c:1147
/usr/local/lib/libruby.so.2.6(vm_call_cfunc+0x10f) [0x7f779def8bff] vm_insnhelper.c:1908
/usr/local/lib/libruby.so.2.6(vm_call_method+0xf3) [0x7f779df0c943] vm_insnhelper.c:2400
/usr/local/lib/libruby.so.2.6(vm_call_opt_send+0x13a) [0x7f779df0cd4a] vm_insnhelper.c:2037
/usr/local/lib/libruby.so.2.6(vm_exec_core+0xa1c) [0x7f779df02bcc] insns.def:750
/usr/local/lib/libruby.so.2.6(rb_vm_exec+0xac) [0x7f779df0899c] vm.c:1885
/usr/local/lib/libruby.so.2.6(rb_yield+0x18c) [0x7f779df0959c] vm.c:1092
/usr/local/lib/libruby.so.2.6(rb_ary_each+0x3c) [0x7f779dce31bc] array.c:2087
/usr/local/lib/libruby.so.2.6(vm_call_cfunc+0x10f) [0x7f779def8bff] vm_insnhelper.c:1908
/usr/local/lib/libruby.so.2.6(vm_exec_core+0xa1c) [0x7f779df02bcc] insns.def:750
/usr/local/lib/libruby.so.2.6(rb_vm_exec+0xac) [0x7f779df0899c] vm.c:1885
/usr/local/lib/libruby.so.2.6(catch_i+0x185) [0x7f779df0b125] vm.c:1092
/usr/local/lib/libruby.so.2.6(vm_catch_protect+0xb4) [0x7f779defcb24] vm_eval.c:1982
/usr/local/lib/libruby.so.2.6(rb_catch_obj+0x2c) [0x7f779defcc8c] vm_eval.c:2008
/usr/local/lib/libruby.so.2.6(vm_call_cfunc+0x10f) [0x7f779def8bff] vm_insnhelper.c:1908
/usr/local/lib/libruby.so.2.6(vm_exec_core+0xa1c) [0x7f779df02bcc] insns.def:750
/usr/local/lib/libruby.so.2.6(rb_vm_exec+0xac) [0x7f779df0899c] vm.c:1885
/usr/local/lib/libruby.so.2.6(rb_yield+0x18c) [0x7f779df0959c] vm.c:1092
/usr/local/lib/libruby.so.2.6(rb_ary_each+0x3c) [0x7f779dce31bc] array.c:2087
/usr/local/lib/libruby.so.2.6(vm_call_cfunc+0x10f) [0x7f779def8bff] vm_insnhelper.c:1908
/usr/local/lib/libruby.so.2.6(vm_exec_core+0xa1c) [0x7f779df02bcc] insns.def:750
/usr/local/lib/libruby.so.2.6(rb_vm_exec+0x7ff) [0x7f779df090ef] vm.c:1894
/usr/local/lib/libruby.so.2.6(rb_vm_invoke_proc+0x292) [0x7f779df0d212] vm.c:1092
/usr/local/lib/libruby.so.2.6(thread_do_start+0x12b) [0x7f779dec253b] thread.c:686
/usr/local/lib/libruby.so.2.6(thread_start_func_2+0x1c7) [0x7f779dec5187] thread.c:725
/usr/local/lib/libruby.so.2.6(thread_start_func_1+0xd6) [0x7f779dec5776] thread_pthread.c:1030
/lib/x86_64-linux-gnu/libpthread.so.0(0x74a4) [0x7f779d87f4a4]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x3f) [0x7f779c9f6d0f]

You can check the full stacktrace in https://gist.github.com/brodock/22dbc591639fe94930d2a661f6d46345

k0kubun commented 4 years ago

Thank you for your report.

that failed in a hamlit parsed file. It seems to point to https://github.com/k0kubun/hamlit/blob/master/ext/hamlit/hamlit.c#L158

Right.

the relevant bits:

While it's indeed failed when calling hamlit's C extension, I believe this is not caused by the C extension but RubyVM itself in this particular output.

The most important part in Ruby's SEGV output for me is "C level backtrace information", which includes:

-- C level backtrace information -------------------------------------------
/usr/local/lib/libruby.so.2.6(rb_vm_bugreport+0x4f1) [0x7f779df18dd1] vm_dump.c:715
/usr/local/lib/libruby.so.2.6(rb_bug_context+0xe7) [0x7f779dd699a7] error.c:609
/usr/local/lib/libruby.so.2.6(sigsegv+0x42) [0x7f779de82252] signal.c:998
/lib/x86_64-linux-gnu/libpthread.so.0(__restore_rt+0x0) [0x7f779d8890e0]
/usr/local/lib/libruby.so.2.6(method_entry_get+0x144) [0x7f779def5834] vm_method.c:813
/usr/local/lib/libruby.so.2.6(vm_respond_to+0x3f) [0x7f779df01dcf] vm_method.c:1990
/usr/local/lib/libruby.so.2.6(rb_check_funcall_default+0x49) [0x7f779df02019] vm_eval.c:358
/usr/local/lib/libruby.so.2.6(rb_check_convert_type_with_id+0x4f) [0x7f779ddfe24f] object.c:2943
/usr/local/lib/libruby.so.2.6(rb_ary_join+0xef) [0x7f779dcf129f] array.c:2315
/builds/gitlab-org/gitlab/vendor/ruby/2.6.0/gems/hamlit-2.11.0/lib/hamlit/hamlit.so(hamlit_build_class+0xd9) [0x7f77901d6349] hamlit.c:158
/usr/local/lib/libruby.so.2.6(vm_call_cfunc+0x10f) [0x7f779def8bff] vm_insnhelper.c:1908

When rb_ary_join was called, Ruby seems to have failed in method_entry_get, which is not in hamlic.c, and I believe hamlit.c does nothing special that could indirectly break that part.

Please report this to https://bugs.ruby-lang.org instead. Thanks.

k0kubun commented 4 years ago

To fix it in either MRI or Hamlit, it'd be nice if we can reproduce it with a small script. Is the /builds/gitlab-org/gitlab/app/views/projects/new.html.haml:53 same as current https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/app/views/projects/new.html.haml#L53?

        #create-from-template-pane.tab-pane.js-toggle-container.px-0.pb-0{ class: active_when(active_tab == 'template'), role: 'tabpanel' }
k0kubun commented 4 years ago
# frozen_string_literal: true
require 'hamlit'
puts "#{RUBY_DESCRIPTION}, hamlit #{Hamlit::VERSION}"

def active_when(condition)
  'active' if condition
end

GC.stress = true
total = 1000
total.times do |i|
  print "#{i}/#{total}\r"
  ::Hamlit::AttributeBuilder.build_class(true, "tab-pane js-toggle-container px-0 pb-0".freeze, active_when(true))
  ::Hamlit::AttributeBuilder.build_class(true, "tab-pane js-toggle-container px-0 pb-0".freeze, active_when(false))
end
ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-linux], hamlit 2.11.0
1000/1000

Hmm...

brodock commented 4 years ago

Is the /builds/gitlab-org/gitlab/app/views/projects/new.html.haml:53 same as current https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/app/views/projects/new.html.haml#L53?

It is...

I don't think this is easily reproducible, as an example, this happened in this spec run: https://gitlab.com/gitlab-org/gitlab/-/jobs/498446202, but after a retry : https://gitlab.com/gitlab-org/gitlab/-/jobs/499303434 it worked. So maybe this depends on other environmental conditions or some fluke on the vm running the tests itself.