Bugs item #28662, was opened at 2010-10-21 13:21
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=1971&aid=28662&group_id=494

Category: None
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Alan Gano (alangano)
Assigned to: Nobody (None)
Summary: Segfault assigning document.root when running in thread

Initial Comment:
Gentoo x86_64; ruby 1.9.2; libxml2 2.7.7; libxml-ruby 1.1.3 (gem)

------------------------------------------------------
#!/opt/ruby/bin/ruby192 -w

require 'libxml'

t1 = Thread.new {
   100000.times { |i|
      document = LibXML::XML::Document.new
      document.root = LibXML::XML::Node.new('test')
   }
}     

t1.join
------------------------------------------------------


Segfault is avoided if:
- .root assignment is removed
- GC.start is called at end of loop
- not run in thread
- the loop is made to run slower (e.g., printing out i variable)


$ ./aa42
./aa42:8: [BUG] Segmentation fault
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-linux]

-- control frame ----------
c:0007 p:---- s:0021 b:0021 l:000020 d:000020 CFUNC  :new
c:0006 p:0047 s:0017 b:0015 l:002258 d:000014 BLOCK  ./aa42:8
c:0005 p:---- s:0011 b:0011 l:000010 d:000010 FINISH
c:0004 p:---- s:0009 b:0009 l:000008 d:000008 CFUNC  :times
c:0003 p:0010 s:0006 b:0006 l:002258 d:000005 BLOCK  ./aa42:6
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:---- s:0002 b:0002 l:000001 d:000001 TOP   
---------------------------
-- Ruby level backtrace information ----------------------------------------
./aa42:6:in `block in <main>'
./aa42:6:in `times'
./aa42:8:in `block (2 levels) in <main>'
./aa42:8:in `new'

-- C level backtrace information -------------------------------------------
/opt/ruby/bin/ruby192(rb_vm_bugreport+0x9e) [0x51e10e]
/opt/ruby/bin/ruby192() [0x55e700]
/opt/ruby/bin/ruby192(rb_bug+0xb1) [0x55e8a1]
/opt/ruby/bin/ruby192() [0x4af468]
/lib/libpthread.so.0(+0xf010) [0x7fb5d3894010]
/lib/libc.so.6(+0x73ddf) [0x7fb5d2cdaddf]
/lib/libc.so.6(cfree+0x6c) [0x7fb5d2cde71c]
/usr/lib/libxml2.so.2(xmlFreeDoc+0x16b) [0x7fb5d214134b]
/opt/ruby/bin/ruby192() [0x423aa4]
/opt/ruby/bin/ruby192(rb_gc_finalize_deferred+0x31) [0x424081]
/opt/ruby/bin/ruby192() [0x520795]
/opt/ruby/bin/ruby192() [0x515437]
/opt/ruby/bin/ruby192(rb_funcall+0xf3) [0x519b43]
/opt/ruby/bin/ruby192(rb_obj_alloc+0x52) [0x452252]
/opt/ruby/bin/ruby192(rb_class_new_instance+0x20) [0x452390]
/opt/ruby/bin/ruby192() [0x50e0f1]
/opt/ruby/bin/ruby192() [0x50f7d6]
/opt/ruby/bin/ruby192() [0x514189]
/opt/ruby/bin/ruby192(rb_yield+0x66) [0x51c3f6]
/opt/ruby/bin/ruby192() [0x449851]
/opt/ruby/bin/ruby192() [0x50e0f1]
/opt/ruby/bin/ruby192() [0x50f7d6]
/opt/ruby/bin/ruby192() [0x514189]
/opt/ruby/bin/ruby192(rb_vm_invoke_proc+0xa1) [0x51a9d1]
/opt/ruby/bin/ruby192() [0x524b41]
/opt/ruby/bin/ruby192() [0x524bfe]
/lib/libpthread.so.0(+0x6894) [0x7fb5d388b894]
/lib/libc.so.6(clone+0x6d) [0x7fb5d2d3827d]

[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

Aborted
$


----------------------------------------------------------------------

>Comment By: Charlie Savage (cfis)
Date: 2011-04-22 21:37

Message:
Hi Alan,

I can't reproduce this using the latest release along with libxml 2.7.8.  I've 
added this as a test case in the test suite.

Can you check with the latest libxml-ruby release?

Thans - Charlie

----------------------------------------------------------------------

Comment By: Alan Gano (alangano)
Date: 2010-10-21 13:25

Message:
It seems that gem is listing the libxml-ruby version as
1.1.4, which is not on your download page(?).  I have
manually installed 1.1.3 (from gem and then from source) and
gotten the same result.


----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=1971&aid=28662&group_id=494
_______________________________________________
libxml-devel mailing list
libxml-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/libxml-devel

Reply via email to