Skip to content
This repository has been archived by the owner on Aug 26, 2023. It is now read-only.

Segfault on parse using 1.4.10 #50

Closed
jbotelho2-bb opened this issue Nov 2, 2016 · 14 comments
Closed

Segfault on parse using 1.4.10 #50

jbotelho2-bb opened this issue Nov 2, 2016 · 14 comments

Comments

@jbotelho2-bb
Copy link
Contributor

I noticed that right after we upgraded to the latest (1.4.10) we are now getting segfaults when parsing certain HTML files as part of our rails asset precompile. For some reason, I can't recreate the segfault on my Mac, but it happens consistently on our CI box running RedHat 6. I can dig deeper to figure out what the actual HTML input is, but I wanted to check if you had some idea of what would cause the segfault first.

In case it helps, the library thats calling nokogumbo is something we maintain, so we can modify it if necessary: https://github.com/uniite/web-components-rails/blob/master/lib/web_components_rails/html_import_processor.rb#L49

Here's the output from the segfault:

/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/nokogumbo-1.4.10/lib/nokogumbo.rb:24: [BUG] Segmentation fault at 0x007fb35c7ab000
ruby 2.1.7p400 (2015-08-18 revision 51632) [x86_64-linux]

-- Control frame information -----------------------------------------------
c:0086 p:---- s:0437 e:000436 CFUNC  :parse
c:0085 p:0072 s:0433 e:000432 METHOD /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/nokogumbo-1.4.10/lib/noko
c:0084 p:0009 s:0429 e:000428 METHOD /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/nokogumbo-1.4.10/lib/noko
c:0083 p:0017 s:0421 e:000420 METHOD /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/web_components_rails-1.2.
c:0082 p:0077 s:0412 e:000411 METHOD /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/web_components_rails-1.2.
c:0081 p:0011 s:0407 e:000406 METHOD /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/web_components_rails-1.2.
c:0080 p:0057 s:0403 e:000402 METHOD /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sproc
c:0079 p:0023 s:0396 e:000395 BLOCK  /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sproc [FINISH]
c:0078 p:---- s:0392 e:000391 CFUNC  :reverse_each
c:0077 p:0044 s:0389 e:000388 METHOD /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sproc
c:0076 p:0351 s:0382 e:000381 METHOD /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sproc
c:0075 p:0077 s:0363 e:000362 BLOCK  /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sproc
c:0074 p:0042 s:0358 e:000357 METHOD /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sproc
c:0073 p:0138 s:0349 e:000348 METHOD /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sproc
c:0072 p:0014 s:0341 e:000337 BLOCK  /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sproc [FINISH]
c:0071 p:---- s:0334 e:000333 CFUNC  :yield
c:0070 p:0011 s:0332 e:000331 METHOD /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sproc
c:0069 p:0010 s:0328 e:000327 BLOCK  /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sproc
c:0068 p:0093 s:0325 e:000322 METHOD /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sproc
c:0067 p:0109 s:0315 E:001ad0 METHOD /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sproc
c:0066 p:0057 s:0301 e:000300 METHOD /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sproc
c:0065 p:0023 s:0294 e:000293 BLOCK  /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sproc [FINISH]
c:0064 p:---- s:0290 e:000289 CFUNC  :reverse_each
c:0063 p:0044 s:0287 e:000286 METHOD /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sproc
c:0062 p:0351 s:0280 e:000279 METHOD /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sproc
c:0061 p:0077 s:0261 e:000260 BLOCK  /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sproc
c:0060 p:0042 s:0256 E:0000e8 METHOD /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sproc
c:0059 p:0138 s:0247 E:002150 METHOD /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sproc
c:0058 p:0014 s:0239 e:000235 BLOCK  /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sproc [FINISH]
c:0057 p:---- s:0232 e:000231 CFUNC  :yield
c:0056 p:0011 s:0230 e:000229 METHOD /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sproc
c:0055 p:0043 s:0226 e:000225 METHOD /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sproc
c:0054 p:0037 s:0219 e:000218 METHOD /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sproc
c:0053 p:0018 s:0211 e:000210 BLOCK  /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sproc
c:0052 p:0099 s:0207 e:000206 BLOCK  /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sproc
c:0051 p:0010 s:0200 e:000199 BLOCK  /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sproc
c:0050 p:0039 s:0196 e:000195 BLOCK  /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sproc [FINISH]
c:0049 p:---- s:0191 e:000190 CFUNC  :each
c:0048 p:0031 s:0188 e:000187 METHOD /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sproc
c:0047 p:0029 s:0184 e:000183 METHOD /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sproc
c:0046 p:0028 s:0179 e:000178 BLOCK  /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sproc
c:0045 p:0039 s:0175 e:000174 BLOCK  /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sproc [FINISH]
c:0044 p:---- s:0170 e:000169 CFUNC  :each
c:0043 p:0031 s:0167 e:000166 METHOD /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sproc
c:0042 p:0029 s:0163 e:000162 METHOD /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sproc
c:0041 p:0028 s:0158 e:000157 BLOCK  /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sproc
c:0040 p:0039 s:0154 e:000153 BLOCK  /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sproc [FINISH]
c:0039 p:---- s:0149 e:000148 CFUNC  :each
c:0038 p:0031 s:0146 e:000145 METHOD /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sproc
c:0037 p:0029 s:0142 e:000141 METHOD /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sproc
c:0036 p:0028 s:0137 e:000136 BLOCK  /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sproc
c:0035 p:0039 s:0133 e:000132 BLOCK  /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sproc [FINISH]
c:0034 p:---- s:0128 e:000127 CFUNC  :each
c:0033 p:0031 s:0125 e:000124 METHOD /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sproc
c:0032 p:0029 s:0121 e:000120 METHOD /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sproc [FINISH]
c:0031 p:---- s:0116 e:000115 CFUNC  :each
c:0030 p:0011 s:0113 E:000460 BLOCK  /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sproc [FINISH]
c:0029 p:---- s:0110 e:000109 CFUNC  :each
c:0028 p:0040 s:0107 E:0014e0 METHOD /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sproc
c:0027 p:0097 s:0103 E:001ca8 METHOD /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sproc
c:0026 p:0049 s:0096 E:0021d8 METHOD /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sproc
c:0025 p:0010 s:0089 e:000088 METHOD /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/non-stupid-digest-assets-
c:0024 p:0012 s:0084 e:000083 BLOCK  /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-rails-3.2.0/lib
c:0023 p:0036 s:0082 e:000081 METHOD /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/rake/
c:0022 p:0007 s:0077 e:000076 BLOCK  /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-rails-3.2.0/lib [FINISH]
c:0021 p:---- s:0075 e:000074 CFUNC  :call
c:0020 p:0028 s:0070 e:000069 BLOCK  /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/rake-11.3.0/lib/rake/task [FINISH]
c:0019 p:---- s:0067 e:000066 CFUNC  :each
c:0018 p:0113 s:0064 e:000063 METHOD /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/rake-11.3.0/lib/rake/task
c:0017 p:0075 s:0060 e:000059 BLOCK  /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/rake-11.3.0/lib/rake/task
c:0016 p:0014 s:0058 e:000057 METHOD /tools/ruby-2.1.7/lib/ruby/2.1.0/monitor.rb:211
c:0015 p:0025 s:0055 e:000054 METHOD /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/rake-11.3.0/lib/rake/task
c:0014 p:0036 s:0048 e:000047 METHOD /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/rake-11.3.0/lib/rake/task
c:0013 p:0033 s:0043 e:000042 METHOD /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/rake-11.3.0/lib/rake/appl
c:0012 p:0009 s:0036 e:000035 BLOCK  /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/rake-11.3.0/lib/rake/appl [FINISH]
c:0011 p:---- s:0033 e:000032 CFUNC  :each
c:0010 p:0039 s:0030 e:000029 BLOCK  /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/rake-11.3.0/lib/rake/appl
c:0009 p:0025 s:0028 e:000027 METHOD /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/rake-11.3.0/lib/rake/appl
c:0008 p:0007 s:0024 e:000023 METHOD /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/rake-11.3.0/lib/rake/appl
c:0007 p:0019 s:0021 e:000020 BLOCK  /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/rake-11.3.0/lib/rake/appl
c:0006 p:0006 s:0019 e:000018 METHOD /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/rake-11.3.0/lib/rake/appl
c:0005 p:0007 s:0015 e:000014 METHOD /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/rake-11.3.0/lib/rake/appl
c:0004 p:0021 s:0012 e:000011 TOP    /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/rake-11.3.0/exe/rake:27 [FINISH]
c:0003 p:---- s:0010 e:000009 CFUNC  :load
c:0002 p:0135 s:0006 E:001be8 EVAL   /ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/bin/rake:23 [FINISH]
c:0001 p:0000 s:0002 E:001528 TOP    [FINISH]

/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/bin/rake:23:in `<main>'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/bin/rake:23:in `load'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/rake-11.3.0/exe/rake:27:in `<top (required)>'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/rake-11.3.0/lib/rake/application.rb:77:in `run'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/rake-11.3.0/lib/rake/application.rb:178:in `standard_exception_handling'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/rake-11.3.0/lib/rake/application.rb:80:in `block in run'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/rake-11.3.0/lib/rake/application.rb:102:in `top_level'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/rake-11.3.0/lib/rake/application.rb:117:in `run_with_threads'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/rake-11.3.0/lib/rake/application.rb:108:in `block in top_level'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/rake-11.3.0/lib/rake/application.rb:108:in `each'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/rake-11.3.0/lib/rake/application.rb:108:in `block (2 levels) in top_level'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/rake-11.3.0/lib/rake/application.rb:152:in `invoke_task'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/rake-11.3.0/lib/rake/task.rb:173:in `invoke'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/rake-11.3.0/lib/rake/task.rb:180:in `invoke_with_call_chain'
/tools/ruby-2.1.7/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/rake-11.3.0/lib/rake/task.rb:187:in `block in invoke_with_call_chain'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/rake-11.3.0/lib/rake/task.rb:243:in `execute'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/rake-11.3.0/lib/rake/task.rb:243:in `each'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/rake-11.3.0/lib/rake/task.rb:248:in `block in execute'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/rake-11.3.0/lib/rake/task.rb:248:in `call'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-rails-3.2.0/lib/sprockets/rails/task.rb:67:in `block (2 levels) in define'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/rake/sprocketstask.rb:147:in `with_logger'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-rails-3.2.0/lib/sprockets/rails/task.rb:68:in `block (3 levels) in define'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/non-stupid-digest-assets-1.0.8/lib/non-stupid-digest-assets.rb:26:in `compile'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/manifest.rb:185:in `compile'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/manifest.rb:140:in `find'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/legacy.rb:104:in `logical_paths'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/legacy.rb:104:in `each'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/legacy.rb:105:in `block in logical_paths'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/legacy.rb:105:in `each'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/path_utils.rb:227:in `stat_tree'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/path_utils.rb:209:in `stat_directory'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/path_utils.rb:209:in `each'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/path_utils.rb:212:in `block in stat_directory'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/path_utils.rb:231:in `block in stat_tree'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/path_utils.rb:227:in `stat_tree'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/path_utils.rb:209:in `stat_directory'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/path_utils.rb:209:in `each'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/path_utils.rb:212:in `block in stat_directory'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/path_utils.rb:231:in `block in stat_tree'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/path_utils.rb:227:in `stat_tree'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/path_utils.rb:209:in `stat_directory'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/path_utils.rb:209:in `each'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/path_utils.rb:212:in `block in stat_directory'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/path_utils.rb:231:in `block in stat_tree'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/path_utils.rb:227:in `stat_tree'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/path_utils.rb:209:in `stat_directory'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/path_utils.rb:209:in `each'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/path_utils.rb:212:in `block in stat_directory'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/path_utils.rb:228:in `block in stat_tree'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/legacy.rb:114:in `block (2 levels) in logical_paths'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/manifest.rb:142:in `block in find'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/base.rb:73:in `find_all_linked_assets'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/base.rb:66:in `find_asset'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/cached_environment.rb:47:in `load'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/cached_environment.rb:47:in `yield'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/cached_environment.rb:20:in `block in initialize'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/loader.rb:44:in `load'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/loader.rb:317:in `fetch_asset_from_dependency_cache'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/loader.rb:60:in `block in load'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/loader.rb:134:in `load_from_unloaded'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/processor_utils.rb:56:in `call_processors'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/processor_utils.rb:56:in `reverse_each'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/processor_utils.rb:57:in `block in call_processors'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/processor_utils.rb:75:in `call_processor'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/bundle.rb:24:in `call'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/utils.rb:196:in `dfs'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/bundle.rb:23:in `block in call'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/cached_environment.rb:47:in `load'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/cached_environment.rb:47:in `yield'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/cached_environment.rb:20:in `block in initialize'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/loader.rb:44:in `load'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/loader.rb:317:in `fetch_asset_from_dependency_cache'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/loader.rb:60:in `block in load'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/loader.rb:134:in `load_from_unloaded'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/processor_utils.rb:56:in `call_processors'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/processor_utils.rb:56:in `reverse_each'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/processor_utils.rb:57:in `block in call_processors'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/sprockets-3.7.0/lib/sprockets/processor_utils.rb:75:in `call_processor'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/web_components_rails-1.2.2/lib/web_components_rails/html_import_processor.rb:16:in `call'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/web_components_rails-1.2.2/lib/web_components_rails/html_import_processor.rb:37:in `call'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/web_components_rails-1.2.2/lib/web_components_rails/html_import_processor.rb:49:in `process_imports'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/nokogumbo-1.4.10/lib/nokogumbo.rb:87:in `fragment'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/nokogumbo-1.4.10/lib/nokogumbo.rb:24:in `parse'
/ci-workspace/rails-project/vendor/bundle/ruby/2.1.0/gems/nokogumbo-1.4.10/lib/nokogumbo.rb:24:in `parse'

-- C level backtrace information -------------------------------------------
@fukayatsu
Copy link

I could reproduce this Segfault on my macbook

nokogumbo (1.4.9) => OK

$ ruby -v
ruby 2.3.2p217 (2016-11-15 revision 56796) [x86_64-darwin15]

$ gem list | grep nokogumbo
nokogumbo (1.4.9)

$ ruby -rnokogumbo -e 'puts Nokogiri::HTML5.fragment("<\r\n")'
&lt;

nokogumbo (1.4.10) => Segfault

$ ruby -v
ruby 2.3.2p217 (2016-11-15 revision 56796) [x86_64-darwin15]

$ gem list | grep nokogumbo
nokogumbo (1.4.10)

$ ruby -rnokogumbo -e 'puts Nokogiri::HTML5.fragment("<\r\n")'
 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogumbo-1.4.10/lib/nokogumbo.rb:24: [BUG] Segmentation fault at 0x007ffccafffff0
ruby 2.3.2p217 (2016-11-15 revision 56796) [x86_64-darwin15]

-- Crash Report log information --------------------------------------------
   See Crash Report log file under the one of following:
     * ~/Library/Logs/CrashReporter
     * /Library/Logs/CrashReporter
     * ~/Library/Logs/DiagnosticReports
     * /Library/Logs/DiagnosticReports
   for more details.
Don't forget to include the above Crash Report log file in bug reports.

-- Control frame information -----------------------------------------------
c:0005 p:---- s:0021 e:000020 CFUNC  :parse
c:0004 p:0081 s:0017 e:000016 METHOD /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogumbo-1.4.10/lib/nokogumbo.rb:24
c:0003 p:0010 s:0013 e:000012 METHOD /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogumbo-1.4.10/lib/nokogumbo.rb:87
c:0002 p:0017 s:0005 E:0001e0 EVAL   -e:1 [FINISH]
c:0001 p:0000 s:0002 E:000450 (none) [FINISH]

-- Ruby level backtrace information ----------------------------------------
-e:1:in `<main>'
/Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogumbo-1.4.10/lib/nokogumbo.rb:87:in `fragment'
/Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogumbo-1.4.10/lib/nokogumbo.rb:24:in `parse'
/Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogumbo-1.4.10/lib/nokogumbo.rb:24:in `parse'

-- Machine register context ------------------------------------------------
 rax: 0x00007ffccad0a65b rbx: 0x0000000000000050 rcx: 0x000000000000001a
 rdx: 0xfffffffffff40de5 rdi: 0x00007ffccac4b480 rsi: 0x00007ffccb000010
 rbp: 0x00007fff5086bc00 rsp: 0x00007fff5086bc00  r8: 0x0000000000000000
  r9: 0x000000010fdbea3a r10: 0x0000000087660f4f r11: 0x00007ffccad0a65a
 r12: 0x00007fff5086bcc8 r13: 0x00007ffccb0bf1e8 r14: 0x00007fff5086bc50
 r15: 0x00007fff5086bce0 rip: 0x00007fff9d803130 rfl: 0x0000000000010202

-- C level backtrace information -------------------------------------------
0   ruby                                0x000000010f53dd94 rb_vm_bugreport + 388
1   ruby                                0x000000010f3d68ba rb_bug_context + 490
2   ruby                                0x000000010f4ac693 sigsegv + 83
3   libsystem_platform.dylib            0x00007fff9d80052a _sigtramp + 26
4   libsystem_platform.dylib            0x00007fff9d803130 _platform_memmove$VARIANT$Haswell + 528

-- Other runtime information -----------------------------------------------

* Loaded script: -e

* Loaded features:

    0 enumerator.so
    1 thread.rb
    2 rational.so
    3 complex.so
    4 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/2.3.0/x86_64-darwin15/enc/encdb.bundle
    5 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/2.3.0/x86_64-darwin15/enc/trans/transdb.bundle
    6 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/2.3.0/unicode_normalize.rb
    7 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/2.3.0/x86_64-darwin15/rbconfig.rb
    8 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/2.3.0/rubygems/compatibility.rb
    9 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/2.3.0/rubygems/defaults.rb
   10 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/2.3.0/rubygems/deprecate.rb
   11 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/2.3.0/rubygems/errors.rb
   12 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/2.3.0/rubygems/version.rb
   13 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/2.3.0/rubygems/requirement.rb
   14 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/2.3.0/rubygems/platform.rb
   15 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/2.3.0/rubygems/basic_specification.rb
   16 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/2.3.0/rubygems/stub_specification.rb
   17 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/2.3.0/rubygems/util/list.rb
   18 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/2.3.0/x86_64-darwin15/stringio.bundle
   19 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/2.3.0/rubygems/specification.rb
   20 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/2.3.0/rubygems/exceptions.rb
   21 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/2.3.0/rubygems/dependency.rb
   22 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/2.3.0/rubygems/core_ext/kernel_gem.rb
   23 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/2.3.0/monitor.rb
   24 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb
   25 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/2.3.0/rubygems.rb
   26 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/2.3.0/rubygems/path_support.rb
   27 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/did_you_mean-1.0.0/lib/did_you_mean/version.rb
   28 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/did_you_mean-1.0.0/lib/did_you_mean/core_ext/name_error.rb
   29 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/did_you_mean-1.0.0/lib/did_you_mean/levenshtein.rb
   30 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/did_you_mean-1.0.0/lib/did_you_mean/jaro_winkler.rb
   31 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/did_you_mean-1.0.0/lib/did_you_mean/spell_checkable.rb
   32 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/2.3.0/delegate.rb
   33 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/did_you_mean-1.0.0/lib/did_you_mean/spell_checkers/name_error_checkers/class_name_checker.rb
   34 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/did_you_mean-1.0.0/lib/did_you_mean/spell_checkers/name_error_checkers/variable_name_checker.rb
   35 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/did_you_mean-1.0.0/lib/did_you_mean/spell_checkers/name_error_checkers.rb
   36 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/did_you_mean-1.0.0/lib/did_you_mean/spell_checkers/method_name_checker.rb
   37 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/did_you_mean-1.0.0/lib/did_you_mean/spell_checkers/null_checker.rb
   38 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/did_you_mean-1.0.0/lib/did_you_mean/formatter.rb
   39 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/did_you_mean-1.0.0/lib/did_you_mean.rb
   40 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/nokogiri.bundle
   41 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/version.rb
   42 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/syntax_error.rb
   43 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/xml/pp/node.rb
   44 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/xml/pp/character_data.rb
   45 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/xml/pp.rb
   46 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/xml/parse_options.rb
   47 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/xml/sax/document.rb
   48 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/xml/sax/parser_context.rb
   49 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/xml/sax/parser.rb
   50 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/xml/sax/push_parser.rb
   51 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/xml/sax.rb
   52 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/xml/searchable.rb
   53 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/xml/node/save_options.rb
   54 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/xml/node.rb
   55 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/xml/attribute_decl.rb
   56 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/xml/element_decl.rb
   57 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/xml/element_content.rb
   58 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/xml/character_data.rb
   59 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/xml/namespace.rb
   60 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/xml/attr.rb
   61 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/xml/dtd.rb
   62 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/xml/cdata.rb
   63 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/xml/text.rb
   64 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/xml/document.rb
   65 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/xml/document_fragment.rb
   66 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/xml/processing_instruction.rb
   67 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/xml/node_set.rb
   68 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/xml/syntax_error.rb
   69 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/xml/xpath/syntax_error.rb
   70 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/xml/xpath.rb
   71 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/xml/xpath_context.rb
   72 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/xml/builder.rb
   73 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/xml/reader.rb
   74 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/xml/notation.rb
   75 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/xml/entity_decl.rb
   76 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/xml/schema.rb
   77 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/xml/relax_ng.rb
   78 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/xml.rb
   79 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/xslt/stylesheet.rb
   80 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/xslt.rb
   81 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/html/entity_lookup.rb
   82 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/html/document.rb
   83 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/html/document_fragment.rb
   84 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/html/sax/parser_context.rb
   85 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/html/sax/parser.rb
   86 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/html/sax/push_parser.rb
   87 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/html/element_description.rb
   88 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/html/element_description_defaults.rb
   89 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/html.rb
   90 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/decorators/slop.rb
   91 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/css/node.rb
   92 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/css/xpath_visitor.rb
   93 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/2.3.0/x86_64-darwin15/racc/cparse.bundle
   94 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/2.3.0/racc/parser.rb
   95 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/css/parser_extras.rb
   96 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/css/parser.rb
   97 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/2.3.0/x86_64-darwin15/strscan.bundle
   98 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/css/tokenizer.rb
   99 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/css/syntax_error.rb
  100 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/css.rb
  101 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri/html/builder.rb
  102 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.8.1/lib/nokogiri.rb
  103 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogumbo-1.4.10/lib/nokogumboc.bundle
  104 /Users/fukayatsu/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/nokogumbo-1.4.10/lib/nokogumbo.rb

@tomhughes
Copy link

I think I'm seeing the same crash - backtrace looks like:

#0  0x00007ffff6cb4cf5 in __memmove_sse2_unaligned_erms () from /lib64/libc.so.6
#1  0x00007fffedcf9929 in memcpy (__len=<optimized out>, __src=<optimized out>, __dest=<optimized out>) at /usr/include/bits/string3.h:53
#2  gumbo_string_buffer_append_string (parser=parser@entry=0x7fffffffd430, str=str@entry=0x7fffffffd380, output=output@entry=0x7fffffffd410) at string_buffer.c:90
#3  0x00007fffedd03341 in gumbo_caret_diagnostic_to_string (parser=parser@entry=0x7fffffffd430, error=error@entry=0x555555e33190, source_text=source_text@entry=0x555555e30bb0 "s     = false\n", output=output@entry=0x7fffffffd410) at error.c:240
#4  0x00007fffedcf3e63 in parse (self=<optimized out>, string=<optimized out>) at nokogumbo.c:230

and here's a test case:

require "nokogumbo"

HTML=<<__END__
Test

>><b>Test</b><<

Test
__END__

Nokogiri::HTML5(HTML)

It's the >> and << that seem to trigger it.

@musaffa
Copy link

musaffa commented Jan 27, 2017

I'm also getting segmentation fault with 1.4.10 but the parsing works with 1.4.9.

@jeremy
Copy link
Contributor

jeremy commented Feb 4, 2017

@stevecheckoway looks like we have a segfault introduced when we add the parse errors to the doc https://github.com/rubys/nokogumbo/pull/46/files#diff-605b9dcccd84567c49656f6590ff3830R230

@stevecheckoway
Copy link
Collaborator

That's no good. I'll try to look into it soon.

@stevecheckoway
Copy link
Collaborator

I tracked down the error, only to find that @DmitryBochkarev had already found it. It's a bug in gumbo-parser google/gumbo-parser#371 but I think that patch is wrong.

When the error happens on a new line, it tries to append a string that is (ptrdiff_t)-1 bytes long.

I created a pull request #51 to work around this bug, but I think a better fix is to fix gumbo.

@keysen
Copy link

keysen commented Apr 4, 2017

👍 I have the issue too with nokogumbo 1.4.10, is there any fixes for this version?

amatriain added a commit to amatriain/feedbunch that referenced this issue Apr 10, 2017
Version 1.4.10 (current one) has a segfault when parsing certain html
documents. This was causing crashes of the sidekiq process leaving feeds
in an inconsistent state. Pinning for now until there is a fix, see:

rubys/nokogumbo#50
@amatriain
Copy link

I think this is bad enough that a rollback of the commits that introduced the issue until a fix is ready would be warranted.

@stevecheckoway
Copy link
Collaborator

The work around in #51 was merged already. So presumably, it'll be in the next version.

@louim
Copy link

louim commented May 16, 2017

@rubys would you mind releasing a new version on rubygem?

@rubys
Copy link
Owner

rubys commented May 16, 2017

Can I get somebody to test drive the following https://intertwingly.net/tmp/nokogumbo-1.4.11.gem ?

@jeremy
Copy link
Contributor

jeremy commented May 17, 2017

@rubys Gave it a roll locally. Gem is packaged fine, installed fine, passes the html-proofer test suite, and I couldn't tickle the segfault.

@rubys
Copy link
Owner

rubys commented May 17, 2017

@jeremy thanks! pushed!

@jbotelho2-bb
Copy link
Contributor Author

Looks like this is solved. Finally got a chance to loop back and test the latest (now 1.4.13), and we're not seeing any segfaults across Mac and Linux.

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants