Bugs item #26839, was opened at 2009-08-04 01:49 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=1971&aid=26839&group_id=494
Category: None Group: None >Status: Closed >Resolution: Accepted Priority: 3 Submitted By: sebastian de castelberg (sdecastelberg) >Assigned to: Charlie Savage (cfis) Summary: segfault: to_s on removed node Initial Comment: The following ruby snippet causes a segmentation fault with libxml-ruby 1.1.3. ####File: libxml_segfault.rb require 'rubygems' require 'xml/libxml' root = XML::Node.new("root") a = XML::Node.new("a") b = XML::Node.new("b") root << a root << b a.parent.remove! puts b ####End File Installed versions ================== ruby: 1.8.7-p174 libxml-ruby: 1.1.3 backtrace ========= gdb --args ruby libxml_segfault.rb GNU gdb 6.3.50-20050815 (Apple version gdb-768) (Tue Oct 2 04:07:49 UTC 2007) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-apple-darwin"...Reading symbols for shared libraries .... done (gdb) run Starting program: /Users/sdecaste/apps/ruby18/bin/ruby libxml_segfault.rb Reading symbols for shared libraries +++... done Reading symbols for shared libraries . done Reading symbols for shared libraries . done Reading symbols for shared libraries . done Reading symbols for shared libraries . done Reading symbols for shared libraries .... done Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_PROTECTION_FAILURE at address: 0x00000020 0x001dd818 in rxml_node_to_s (argc=0, argv=0x0, self=5899740) at ruby_xml_node.c:571 571 xmlNodeDumpOutput(output, xnode->doc, xnode, level, indent, xencoding); (gdb) backtrace #0 0x001dd818 in rxml_node_to_s (argc=0, argv=0x0, self=5899740) at ruby_xml_node.c:571 #1 0x0001aaa5 in call_cfunc (func=0x1dd6c0 <rxml_node_to_s>, recv=5899740, len=<value temporarily unavailable, due to optimizations>, argc=0, argv=0x0) at eval.c:5762 #2 0x00024ad2 in rb_call0 (klass=6063400, recv=5899740, id=3137, oid=3137, argc=125864, argv=0x0, body=0x5c7e48, flags=<value temporarily unavailable, due to optimizations>) at eval.c:5917 #3 0x000256dc in rb_call (klass=6063400, recv=5899740, mid=3137, argc=0, argv=0x0, scope=0, self=1296720) at eval.c:6164 #4 0x00023017 in rb_eval (self=1296720, n=<value temporarily unavailable, due to optimizations>) at eval.c:3503 #5 0x00021fb0 in rb_eval (self=1296720, n=<value temporarily unavailable, due to optimizations>) at eval.c:3513 #6 0x00032e67 in ruby_exec_internal () at eval.c:1652 #7 0x00032ea6 in ruby_exec () at eval.c:1672 #8 0x00032eda in ruby_run () at eval.c:1682 #9 0x000019dd in main (argc=0, argv=0x0, envp=0xbffff384) at main.c:48 With libxml-ruby 0.8.3 ====================== When running the script with libxml-ruby 0.8.3, puts b prints the content of b. ruby libxml_segfault.rb <b/> ---------------------------------------------------------------------- >Comment By: Charlie Savage (cfis) Date: 2011-04-22 23:38 Message: Hi Sebastian, Thanks for the report. This has been fixed in trunk and will be in the next libxml-ruby release. Charlie ---------------------------------------------------------------------- Comment By: sebastian de castelberg (sdecastelberg) Date: 2009-08-04 02:04 Message: btw: libxml versions used: libxml2.2.dylib (os x 10.5.7) and libxml2.so.2.7.3 (linux) ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=1971&aid=26839&group_id=494 _______________________________________________ libxml-devel mailing list libxml-devel@rubyforge.org http://rubyforge.org/mailman/listinfo/libxml-devel