IT土方のメモ

御徒町で働くIT土方が得たネタをお届け

Hpricotが謎のエラーを吐く

ググってもさっぱり意味がわからない。

しかも再現せず。困った。

 

/usr/local/rvm/gems/ruby-1.9.3-p194/gems/hpricot-0.8.6/lib/hpricot/parse.rb:33: [BUG] Segmentation fault

ruby 1.9.3p194 (2012-04-20 revision 35410) [i686-linux]

 

-- Control frame information -----------------------------------------------

c:0024 p:---- s:0094 b:0094 l:000093 d:000093 CFUNC  :scan

c:0023 p:0074 s:0089 b:0089 l:000088 d:000088 METHOD /usr/local/rvm/gems/ruby-1.9.3-p194/gems/hpricot-0.8.6/lib/hpricot/parse.rb:33

c:0022 p:0030 s:0082 b:0082 l:000081 d:000081 METHOD /usr/local/rvm/gems/ruby-1.9.3-p194/gems/hpricot-0.8.6/lib/hpricot/parse.rb:4

c:0021 p:0193 s:0076 b:0076 l:000064 d:000075 BLOCK xxxxxxxxxxxxxx:65

c:0020 p:---- s:0070 b:0070 l:000069 d:000069 FINISH

c:0019 p:---- s:0068 b:0068 l:000067 d:000067 CFUNC  :times

c:0018 p:0089 s:0065 b:0065 l:000064 d:000064 METHOD xxxxxxxxxxxxxx:52

c:0017 p:0036 s:0058 b:0058 l:000048 d:000057 BLOCK xxxxxxxxxxxxxx:71

c:0016 p:---- s:0054 b:0054 l:000053 d:000053 FINISH

c:0015 p:---- s:0052 b:0052 l:000051 d:000051 CFUNC  :each

c:0014 p:0065 s:0049 b:0049 l:000048 d:000048 METHOD xxxxxxxxxxxxxx:68

c:0013 p:0090 s:0043 b:0043 l:000042 d:000042 METHOD xxxxxxxxxxxxxx:24

c:0012 p:0015 s:0034 b:0034 l:0007b4 d:000033 EVAL   (eval):1

c:0011 p:---- s:0032 b:0032 l:000031 d:000031 FINISH

c:0010 p:---- s:0030 b:0030 l:000029 d:000029 CFUNC  :eval

c:0009 p:0314 s:0026 b:0026 l:0007b4 d:0007b4 TOP    /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.6/lib/rails/commands/runner.rb:53

c:0008 p:---- s:0022 b:0022 l:000021 d:000021 FINISH

c:0007 p:---- s:0020 b:0020 l:000019 d:000019 CFUNC  :require

c:0006 p:0783 s:0016 b:0016 l:000015 d:000015 TOP    /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.6/lib/rails/commands.rb:64

c:0005 p:---- s:0012 b:0012 l:000011 d:000011 FINISH

c:0004 p:---- s:0010 b:0010 l:000009 d:000009 CFUNC  :require

c:0003 p:0061 s:0006 b:0006 l:000f3c d:002584 EVAL   script/rails:6

c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH

c:0001 p:0000 s:0002 b:0002 l:000f3c d:000f3c TOP   

 

※2012/12/12 追記

Hpricot.buffer_sizeにサイズを設定する事で回避できるようになった。

再現しないと思ってたのは、時々容量が多くなっていたからと思われ。

Hpricot.buffer_sizeはバイト単位で設定する。ソース除いたらCのコードで書かれているのね。