Subject: | core dump |
XML-LibXML-1.54
perl v5.6.1
FreeBSD 4.6
libxml2-2.5.6
this does not coredump with 1.52
Show quoted text
---- simplest test case ----
#!/usr/local/bin/perl -w
use strict;
use XML::LibXML;
my $xml = do { local $/; $_ = <DATA> };
my $parser = XML::LibXML->new;
my $doc = eval { $parser->parse_string($xml) };
die $@ if $@;
## <a>
my $root_node = $doc->getDocumentElement;
## removing this extra level of scope stops the coredump, but the dom is
## left unchanged and several of the following warnings are issued:
## perl in free(): warning: chunk is already free
{
my ($last_c_node) = $root_node->findnodes('b/c[last()]');
$root_node->removeChild($last_c_node);
}
print $root_node->toString, "\n";
__END__
<?xml version="1.0"?>
<a>
<b>
<c>test 1</c>
<c>test 2</c>
</b>
</a>