https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112012-08-21T10:50:45ZRuby Issue Tracking SystemRuby master - Bug #6892: segfault of interpreter (possibly related to libxml-ruby)https://bugs.ruby-lang.org/issues/6892?journal_id=289492012-08-21T10:50:45Zdrbrain (Eric Hodel)drbrain@segment7.net
<ul></ul><p>Can you reproduce the segfault without loading libxml-ruby?</p> Ruby master - Bug #6892: segfault of interpreter (possibly related to libxml-ruby)https://bugs.ruby-lang.org/issues/6892?journal_id=323262012-11-04T12:12:08Zmame (Yusuke Endoh)mame@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Third Party's Issue</i></li><li><strong>Assignee</strong> set to <i>authorNari (Narihiro Nakamura)</i></li><li><strong>Target version</strong> set to <i>2.0.0</i></li></ul><p>This is very subtle bug.</p>
<p>libxml makes sure to free a object by writing NULL to the entries,<br>
which breaks Ruby internal finalizing list.</p>
<p>Applying the following patch to libxml fixes the issue in my<br>
environment.<br>
But because I'm not familiar with libxml internal, the fix may not<br>
be appropriate. Could you contact on libxml developer(s)?</p>
<p>Thanks,</p>
<p>diff --git a/ext/libxml/ruby_xml_node.c b/ext/libxml/ruby_xml_node.c<br>
index 926875c..174d17d 100644<br>
--- a/ext/libxml/ruby_xml_node.c<br>
+++ b/ext/libxml/ruby_xml_node.c<br>
@@ -50,8 +50,6 @@ static void rxml_node_deregisterNode(xmlNodePtr xnode)<br>
try to free the node a second time. */<br>
VALUE node = (VALUE) xnode->_private;<br>
RDATA(node)->data = NULL;</p>
<ul>
<li>RDATA(node)->dfree = NULL;</li>
<li>RDATA(node)->dmark = NULL;<br>
}<br>
}</li>
</ul>
<p>--<br>
Yusuke Endoh <a href="mailto:mame@tsg.ne.jp" class="email">mame@tsg.ne.jp</a></p>