Foodcritic / foodcritic

Lint tool for Chef cookbooks.
http://foodcritic.io
MIT License
407 stars 153 forks source link

ruby segfault / foodcritic 1.0.0 / nokogiri 1.5.2 #18

Closed miah closed 12 years ago

miah commented 12 years ago

[miahjohnson@zookeeper]$: foodcritic . /Users/miahjohnson/.rvm/gems/ruby-1.9.3-p0@chef-0.10.8/gems/nokogiri-1.5.2/lib/nokogiri/xml/node.rb:159: [BUG] Segmentation fault ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0]

-- Control frame information ----------------------------------------------- c:0031 p:---- s:0123 b:0123 l:000122 d:000122 CFUNC :evaluate c:0030 p:0101 s:0118 b:0118 l:000108 d:000117 BLOCK /Users/miahjohnson/.rvm/gems/ruby-1.9.3-p0@chef-0.10.8/gems/nokogiri-1.5.2/lib/nokogiri/xml/node.rb:159 c:0029 p:---- s:0114 b:0114 l:000113 d:000113 FINISH c:0028 p:---- s:0112 b:0112 l:000111 d:000111 CFUNC :map c:0027 p:0070 s:0109 b:0109 l:000108 d:000108 METHOD /Users/miahjohnson/.rvm/gems/ruby-1.9.3-p0@chef-0.10.8/gems/nokogiri-1.5.2/lib/nokogiri/xml/node.rb:150 c:0026 p:0127 s:0101 b:0101 l:000100 d:000100 METHOD /Users/miahjohnson/.rvm/gems/ruby-1.9.3-p0@chef-0.10.8/gems/foodcritic-1.0.0/lib/foodcritic/api.rb:26 c:0025 p:0027 s:0093 b:0093 l:000250 d:000092 BLOCK /Users/miahjohnson/.rvm/gems/ruby-1.9.3-p0@chef-0.10.8/gems/foodcritic-1.0.0/lib/foodcritic/rules.rb:186 c:0024 p:---- s:0090 b:0090 l:000089 d:000089 FINISH c:0023 p:---- s:0088 b:0088 l:000087 d:000087 CFUNC :map c:0022 p:0018 s:0085 b:0082 l:000250 d:000081 BLOCK /Users/miahjohnson/.rvm/gems/ruby-1.9.3-p0@chef-0.10.8/gems/foodcritic-1.0.0/lib/foodcritic/rules.rb:185 c:0021 p:---- s:0079 b:0079 l:000078 d:000078 FINISH c:0020 p:---- s:0077 b:0077 l:000076 d:000076 CFUNC :map c:0019 p:0045 s:0074 b:0074 l:000250 d:000073 BLOCK /Users/miahjohnson/.rvm/gems/ruby-1.9.3-p0@chef-0.10.8/gems/foodcritic-1.0.0/lib/foodcritic/rules.rb:185 c:0018 p:---- s:0067 b:0067 l:000066 d:000066 FINISH c:0017 p:---- s:0065 b:0065 l:000064 d:000064 CFUNC :yield c:0016 p:0035 s:0061 b:0061 l:000060 d:000060 METHOD /Users/miahjohnson/.rvm/gems/ruby-1.9.3-p0@chef-0.10.8/gems/foodcritic-1.0.0/lib/foodcritic/linter.rb:109 c:0015 p:0196 s:0055 b:0054 l:000034 d:000053 BLOCK /Users/miahjohnson/.rvm/gems/ruby-1.9.3-p0@chef-0.10.8/gems/foodcritic-1.0.0/lib/foodcritic/linter.rb:63 c:0014 p:---- s:0050 b:0050 l:000049 d:000049 FINISH c:0013 p:---- s:0048 b:0048 l:000047 d:000047 CFUNC :each c:0012 p:0081 s:0045 b:0045 l:000034 d:000044 BLOCK /Users/miahjohnson/.rvm/gems/ruby-1.9.3-p0@chef-0.10.8/gems/foodcritic-1.0.0/lib/foodcritic/linter.rb:59 c:0011 p:---- s:0040 b:0040 l:000039 d:000039 FINISH c:0010 p:---- s:0038 b:0038 l:000037 d:000037 CFUNC :each c:0009 p:0121 s:0035 b:0035 l:000034 d:000034 METHOD /Users/miahjohnson/.rvm/gems/ruby-1.9.3-p0@chef-0.10.8/gems/foodcritic-1.0.0/lib/foodcritic/linter.rb:56 c:0008 p:0141 s:0026 b:0026 l:000025 d:000025 METHOD /Users/miahjohnson/.rvm/gems/ruby-1.9.3-p0@chef-0.10.8/gems/foodcritic-1.0.0/lib/foodcritic/linter.rb:25 c:0007 p:0043 s:0021 b:0021 l:000020 d:000020 CLASS /Users/miahjohnson/.rvm/gems/ruby-1.9.3-p0@chef-0.10.8/gems/foodcritic-1.0.0/bin/foodcritic:5 c:0006 p:0021 s:0015 b:0015 l:000014 d:000014 TOP /Users/miahjohnson/.rvm/gems/ruby-1.9.3-p0@chef-0.10.8/gems/foodcritic-1.0.0/bin/foodcritic:3 c:0005 p:---- s:0013 b:0013 l:000012 d:000012 FINISH c:0004 p:---- s:0011 b:0011 l:000010 d:000010 CFUNC :load c:0003 p:0127 s:0007 b:0007 l:001818 d:0006d0 EVAL /Users/miahjohnson/.rvm/gems/ruby-1.9.3-p0@chef-0.10.8/bin/foodcritic:19 c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH c:0001 p:0000 s:0002 b:0002 l:001818 d:001818 TOP

-- Ruby level backtrace information ---------------------------------------- /Users/miahjohnson/.rvm/gems/ruby-1.9.3-p0@chef-0.10.8/bin/foodcritic:19:in <main>' /Users/miahjohnson/.rvm/gems/ruby-1.9.3-p0@chef-0.10.8/bin/foodcritic:19:inload' /Users/miahjohnson/.rvm/gems/ruby-1.9.3-p0@chef-0.10.8/gems/foodcritic-1.0.0/bin/foodcritic:3:in <top (required)>' /Users/miahjohnson/.rvm/gems/ruby-1.9.3-p0@chef-0.10.8/gems/foodcritic-1.0.0/bin/foodcritic:5:inmodule:FoodCritic' /Users/miahjohnson/.rvm/gems/ruby-1.9.3-p0@chef-0.10.8/gems/foodcritic-1.0.0/lib/foodcritic/linter.rb:25:in check' /Users/miahjohnson/.rvm/gems/ruby-1.9.3-p0@chef-0.10.8/gems/foodcritic-1.0.0/lib/foodcritic/linter.rb:56:incheck' /Users/miahjohnson/.rvm/gems/ruby-1.9.3-p0@chef-0.10.8/gems/foodcritic-1.0.0/lib/foodcritic/linter.rb:56:in each' /Users/miahjohnson/.rvm/gems/ruby-1.9.3-p0@chef-0.10.8/gems/foodcritic-1.0.0/lib/foodcritic/linter.rb:59:inblock in check' /Users/miahjohnson/.rvm/gems/ruby-1.9.3-p0@chef-0.10.8/gems/foodcritic-1.0.0/lib/foodcritic/linter.rb:59:in each' /Users/miahjohnson/.rvm/gems/ruby-1.9.3-p0@chef-0.10.8/gems/foodcritic-1.0.0/lib/foodcritic/linter.rb:63:inblock (2 levels) in check' /Users/miahjohnson/.rvm/gems/ruby-1.9.3-p0@chef-0.10.8/gems/foodcritic-1.0.0/lib/foodcritic/linter.rb:109:in matches' /Users/miahjohnson/.rvm/gems/ruby-1.9.3-p0@chef-0.10.8/gems/foodcritic-1.0.0/lib/foodcritic/linter.rb:109:inyield' /Users/miahjohnson/.rvm/gems/ruby-1.9.3-p0@chef-0.10.8/gems/foodcritic-1.0.0/lib/foodcritic/rules.rb:185:in block (3 levels) in load' /Users/miahjohnson/.rvm/gems/ruby-1.9.3-p0@chef-0.10.8/gems/foodcritic-1.0.0/lib/foodcritic/rules.rb:185:inmap' /Users/miahjohnson/.rvm/gems/ruby-1.9.3-p0@chef-0.10.8/gems/foodcritic-1.0.0/lib/foodcritic/rules.rb:185:in block (4 levels) in load' /Users/miahjohnson/.rvm/gems/ruby-1.9.3-p0@chef-0.10.8/gems/foodcritic-1.0.0/lib/foodcritic/rules.rb:185:inmap' /Users/miahjohnson/.rvm/gems/ruby-1.9.3-p0@chef-0.10.8/gems/foodcritic-1.0.0/lib/foodcritic/rules.rb:186:in block (5 levels) in load' /Users/miahjohnson/.rvm/gems/ruby-1.9.3-p0@chef-0.10.8/gems/foodcritic-1.0.0/lib/foodcritic/api.rb:26:inattribute_access' /Users/miahjohnson/.rvm/gems/ruby-1.9.3-p0@chef-0.10.8/gems/nokogiri-1.5.2/lib/nokogiri/xml/node.rb:150:in xpath' /Users/miahjohnson/.rvm/gems/ruby-1.9.3-p0@chef-0.10.8/gems/nokogiri-1.5.2/lib/nokogiri/xml/node.rb:150:inmap' /Users/miahjohnson/.rvm/gems/ruby-1.9.3-p0@chef-0.10.8/gems/nokogiri-1.5.2/lib/nokogiri/xml/node.rb:159:in block in xpath' /Users/miahjohnson/.rvm/gems/ruby-1.9.3-p0@chef-0.10.8/gems/nokogiri-1.5.2/lib/nokogiri/xml/node.rb:159:inevaluate'

-- C level backtrace information -------------------------------------------

See Crash Report log file under ~/Library/Logs/CrashReporter or /Library/Logs/CrashReporter, for the more detail of.

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

[NOTE] You may have encountered a bug in the Ruby interpreter or extension libraries. Bug reports are welcome. For details: http://www.ruby-lang.org/bugreport.html

Abort trap: 6 [miahjohnson@zookeeper]$: foodcritic --version foodcritic 1.0.0

[miahjohnson@zookeeper]$: ruby --version ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0]

[miahjohnson@zookeeper]$: gem list --local

* LOCAL GEMS *

addressable (2.2.7) archive-tar-minitar (0.5.2) builder (3.0.0) bunny (0.7.9, 0.7.8) chef (0.10.8) chefspec (0.5.0, 0.4.0) childprocess (0.3.1, 0.3.0) coderay (1.0.5, 0.9.8) configuration (1.3.1) cucumber (1.1.9, 1.1.8, 1.1.4) diff-lcs (1.1.3) erubis (2.7.0) excon (0.10.1, 0.10.0, 0.9.6, 0.9.5, 0.6.6) ffi (1.0.11) fog (1.1.2, 0.8.2) foodcritic (1.0.0, 0.11.0, 0.10.0, 0.9.0) formatador (0.2.1) gherkin (2.9.0, 2.8.0, 2.7.6) gist (2.0.4) highline (1.6.11, 1.6.9) i18n (0.6.0) json (1.6.5, 1.6.1, 1.5.4) knife-ec2 (0.5.10) knife-github-cookbooks (0.1.5) launchy (2.0.5, 0.4.0) librarian (0.0.14, 0.0.12) log4r (1.1.10) method_source (0.7.1, 0.7.0, 0.6.7) mime-types (1.17.2) minitest (2.11.3, 2.11.2, 2.11.1, 2.10.1, 2.10.0) mixlib-authentication (1.1.4) mixlib-cli (1.2.2) mixlib-config (1.1.2) mixlib-log (1.3.0) moneta (0.6.0) multi_json (1.1.0, 1.0.4) net-scp (1.0.4) net-ssh (2.3.0, 2.2.2, 2.1.4) net-ssh-gateway (1.1.0) net-ssh-multi (1.1) nokogiri (1.5.2, 1.5.0) ohai (0.6.10) open4 (1.3.0) Platform (0.4.0) polyglot (0.3.3) popen4 (0.1.2) progressbar (0.10.0) pry (0.9.8.4, 0.9.8.3, 0.9.8.2, 0.9.8.1, 0.9.7.4) pry-doc (0.4.1, 0.4.0, 0.3.0) rak (1.4) rake (0.9.2.2, 0.8.7) redcarpet (2.1.0) rest-client (1.6.7) rspec (2.8.0) rspec-core (2.8.0) rspec-expectations (2.8.0) rspec-mocks (2.8.0) ruby-hmac (0.4.0) ruby_parser (2.3.1) sexp_processor (3.1.0, 3.0.10) slop (3.0.4, 2.4.4, 2.4.3, 2.1.0) spiceweasel (1.0.0) systemu (2.5.0, 2.4.2, 2.2.0) term-ansicolor (1.0.7) thor (0.14.6) treetop (1.4.10) uuidtools (2.1.2) vagrant (1.0.1, 1.0.0, 0.9.7, 0.9.5, 0.9.2, 0.9.0) veewee (0.2.3) virtualbox (0.9.2) yajl-ruby (1.1.0, 1.0.0) yard (0.7.5, 0.7.4) [miahjohnson@zookeeper]$:

acrmp commented 12 years ago

Hi Miah,

Thanks for reporting this - I can reproduce on Oneiric as well. Reverting to Nokogiri 1.5.0 fixed it for me.

I'm about to head out for a bit but will look into this further this evening.

Thanks,

Andrew.

acrmp commented 12 years ago

It seems to be related to changes made to Nokogiri custom xpath functions code in 1.5.1.

I've isolated it reproducibly here: https://gist.github.com/2040448

And emailed nokogiri-talk as required by their bug submission policy: http://nokogiri.org/tutorials/getting_help.html

acrmp commented 12 years ago

Hi Miah,

I've pushed foodcritic 1.0.1 which locks foodcritic to Nokogiri 1.5.0 until a fix is released.

miah commented 12 years ago

Excellent, its working! Thanks for the very quick response =)