Subject: | Segmentation fault when extracting elements from an XML chunk |
Date: | Thu, 25 Oct 2007 10:47:33 +0200 |
To: | bug-XML-LibXML [...] rt.cpan.org |
From: | "David Serrano" <dserrano5 [...] gmail.com> |
The following script causes a segfault on my machine:
#!/usr/bin/perl
## the version of XML::LibXML installed in the system
## is 1.63, so I tried installing 1.65 here:
BEGIN { unshift @INC, '/tmp/pm/lib/perl/5.8.8'; }
use warnings;
use strict;
use XML::LibXML;
print "Version: ", $XML::LibXML::VERSION, "\n";
my $parser = XML::LibXML->new;
my $item = $parser->parse_balanced_chunk (<<'EOT');
<item>
<title>Insert title here</title>
<link>http://foo/bar.html</link>
<description>Insert description here</description>
<guid isPermaLink="false">foobar@19700101:000000+0000</guid>
</item>
EOT
my $title = $item->findvalue ('//title');
print "Still alive!\n";
my $date = $item->findvalue ('//guid');
print "Still alive!\n";
print "got title ($title) and date ($date)\n";
__END__
I don't know if it's related with XML::LibXML or libxml2. I've tried
it on two boxes with libxml versions 2.6.27 and 2.6.30. This has been
minimally discussed in http://www.perlmonks.org/?node_id=646313, where
I was told to report it as a bug.
Thank you,
--
David Serrano