Bug #5990

Random Segmentation Fault when running on Linux Fedora

Added by Blair Silverberg about 2 years ago. Updated about 1 year ago.

[ruby-core:42456]
Status:Third Party's Issue
Priority:Normal
Assignee:Aaron Patterson
Category:-
Target version:-
ruby -v:1.9.2p290 Backport:

Description

I am parsing a large library of html documents with ruby mechanize/nokogiri. Randomly, I encounter a segmentation fault.

This happens on both ruby 1.9.2 (ruby 1.9.2p290 (2011-07-09 revision 32553) [x8664-linux]) and 1.9.3 (ruby 1.9.3p0 (2011-10-30 revision 33570) [x8664-linux])

I am running Linux Fedora Laughlin 16 on rackspace

Linux 2.6.35.6-45.fc14.x8664 #1 SMP Mon Oct 18 23:57:44 UTC 2010 x8664 x8664 x8664 GNU/Linux

Fedora release 14 (Laughlin)
Kernel \r on an \m (\l)

/root/code/myteam/classes/profilepagescraper.rb:116: [BUG] Segmentation fault
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]

-- control frame ----------
c:0022 p:0010 s:0088 b:0086 l:000085 d:000085 METHOD /root/code/myteam/classes/profilepagescraper.rb:116
c:0021 p:0027 s:0082 b:0080 l:000079 d:000079 METHOD /root/code/myteam/classes/profilepagescraper.rb:120
c:0020 p:0017 s:0076 b:0074 l:001ed8 d:000073 BLOCK /root/code/myteam/classes/mysitescraper.rb:115
c:0019 p:0015 s:0069 b:0069 l:000059 d:000068 BLOCK /usr/local/rvm/gems/ruby-1.9.2-p290/gems/nokogiri-1.5.0/lib/nokogiri/xml/node
set.rb:239
c:0018 p:---- s:0066 b:0066 l:000065 d:000065 FINISH
c:0017 p:---- s:0064 b:0064 l:000063 d:000063 CFUNC :upto
c:0016 p:0023 s:0060 b:0060 l:000059 d:000059 METHOD /usr/local/rvm/gems/ruby-1.9.2-p290/gems/nokogiri-1.5.0/lib/nokogiri/xml/nodeset.rb:238
c:0015 p:0924 s:0056 b:0056 l:001ed8 d:001ed8 METHOD /root/code/myteam/classes/mysite
scraper.rb:113
c:0014 p:0032 s:0045 b:0045 l:000036 d:000044 BLOCK /root/code/myteam/scrapeuser.rb:23
c:0013 p:---- s:0042 b:0042 l:000041 d:000041 FINISH
c:0012 p:---- s:0040 b:0040 l:000039 d:000039 CFUNC :each
c:0011 p:0120 s:0037 b:0037 l:000036 d:000036 TOP /root/code/myteam/scrape
user.rb:21
c:0010 p:---- s:0034 b:0034 l:000033 d:000033 FINISH
c:0009 p:---- s:0032 b:0032 l:000031 d:000031 CFUNC :require
c:0008 p:0036 s:0028 b:0028 l:000027 d:000027 METHOD /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/siteruby/1.9.1/rubygems/customrequire.rb:36
c:0007 p:0056 s:0021 b:0021 l:000012 d:000020 BLOCK /root/code/myteam/helpers/helpers.rb:7
c:0006 p:---- s:0018 b:0018 l:000017 d:000017 FINISH
c:0005 p:---- s:0016 b:0016 l:000015 d:000015 CFUNC :each
c:0004 p:0066 s:0013 b:0013 l:000012 d:000012 METHOD /root/code/myteam/helpers/helpers.rb:5
c:0003 p:0050 s:0007 b:0007 l:0000b8 d:002340 EVAL ./scrape_user.rb:6
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH

c:0001 p:0000 s:0002 b:0002 l:0000b8 d:0000b8 TOP

-- Ruby level backtrace information ----------------------------------------
./scrapeuser.rb:6:in <main>'
/root/code/myteam/helpers/helpers.rb:5:in
require
all'
/root/code/myteam/helpers/helpers.rb:5:in each'
/root/code/myteam/helpers/helpers.rb:7:in
block in requireall'
/usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/site
ruby/1.9.1/rubygems/customrequire.rb:36:in require'
/usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
require'
/root/code/myteam/scrape
user.rb:21:in <top (required)>'
/root/code/myteam/scrape_user.rb:21:in
each'
/root/code/myteam/scrapeuser.rb:23:in block in <top (required)>'
/root/code/myteam/classes/mysite_scraper.rb:113:in
scrape
user'
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/nokogiri-1.5.0/lib/nokogiri/xml/nodeset.rb:238:in each'
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/nokogiri-1.5.0/lib/nokogiri/xml/node_set.rb:238:in
upto'
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/nokogiri-1.5.0/lib/nokogiri/xml/node
set.rb:239:in block in each'
/root/code/myteam/classes/mysite_scraper.rb:115:in
block in scrapeuser'
/root/code/myteam/classes/profile
pagescraper.rb:120:in get_my_url'
/root/code/myteam/classes/profile_page_scraper.rb:116:in
get
my_id'

-- C level backtrace information -------------------------------------------
/usr/local/rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(rbvmbugreport+0x5f) [0x7fc76ec380cf]
/usr/local/rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x60564) [0x7fc76eb17564]
/usr/local/rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(rbbug+0xb3) [0x7fc76eb18493]
/usr/local/rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x1143b5) [0x7fc76ebcb3b5]
/lib64/libpthread.so.0() [0x328540eeb0]
/usr/local/rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(rb
methodentrygetwithoutcache+0x20) [0x7fc76ec25750]
/usr/local/rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x176965) [0x7fc76ec2d965]
/usr/local/rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x176f5b) [0x7fc76ec2df5b]
/usr/local/rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(rbyield+0x47) [0x7fc76ec32e57]
/usr/local/rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0xaa161) [0x7fc76eb61161]
/usr/local/rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x17afa6) [0x7fc76ec31fa6]
/usr/local/rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x1710ee) [0x7fc76ec280ee]
/usr/local/rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x176f5b) [0x7fc76ec2df5b]
/usr/local/rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(rb
yield+0x47) [0x7fc76ec32e57]
/usr/local/rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(rbaryeach+0x46) [0x7fc76eae6816]
/usr/local/rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x17afa6) [0x7fc76ec31fa6]
/usr/local/rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x1710ee) [0x7fc76ec280ee]
/usr/local/rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x176f5b) [0x7fc76ec2df5b]
/usr/local/rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(rbiseqeval+0x1f0) [0x7fc76ec33340]
/usr/local/rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x6a0d0) [0x7fc76eb210d0]
/usr/local/rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(rbrequiresafe+0x6cf) [0x7fc76eb225cf]
/usr/local/rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x17afa6) [0x7fc76ec31fa6]
/usr/local/rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x1710ee) [0x7fc76ec280ee]
/usr/local/rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x176f5b) [0x7fc76ec2df5b]
/usr/local/rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(rbyield+0x47) [0x7fc76ec32e57]
/usr/local/rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(rb
aryeach+0x46) [0x7fc76eae6816]
/usr/local/rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x17afa6) [0x7fc76ec31fa6]
/usr/local/rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x1710ee) [0x7fc76ec280ee]
/usr/local/rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x176f5b) [0x7fc76ec2df5b]
/usr/local/rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(rb
iseqevalmain+0xb1) [0x7fc76ec33441]
/usr/local/rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x66a1a) [0x7fc76eb1da1a]
/usr/local/rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(rubyexecnode+0x1d) [0x7fc76eb1e88d]
/usr/local/rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(rubyrunnode+0x1e) [0x7fc76eb20afe]
ruby(main+0x4b) [0x40091b]
/lib64/libc.so.6(_libcstart_main+0xfd) [0x3284c1ee5d]
ruby() [0x400809]

[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

History

#1 Updated by Yui NARUSE about 2 years ago

  • Status changed from Open to Feedback

Could you show a small reproducible code?

#2 Updated by Yusuke Endoh over 1 year ago

  • Status changed from Feedback to Assigned
  • Assignee set to Aaron Patterson

Aaron, do you know anything?

Yusuke Endoh mame@tsg.ne.jp

#3 Updated by Aaron Patterson over 1 year ago

  • Status changed from Assigned to Feedback

This is either a GC bug or a bug in Nokogiri. nari-san fixed GC bugs for us, but I'm not sure what patch level. Blair, can you try this with the latest 1.9.3 patch level? If there is still a problem on 1.9.3, then it's probably a bug in Nokogiri.

#4 Updated by Eric Hodel about 1 year ago

  • Status changed from Feedback to Third Party's Issue

Due to lack of feedback I'm marking this as third party issue. No mention of a bug in ruby has been made.

Also available in: Atom PDF