Subject: | Parsing/escaping bug |
Date: | Mon, 5 Mar 2012 16:55:38 +0000 |
To: | <bug-XML-Mini [...] rt.cpan.org> |
From: | Jon Knight <J.P.Knight [...] lboro.ac.uk> |
XML::Mini::Document version: 1.38
Perl version: v5.8.8
Linux version: 2.6.18-274.el5xen
Problem:
When an XML document that contains a back slash ('\') before an XML
element, the XML::Mini::Document parser appears to go into an infinite
loop. Here's some example code:
---- 8< snip snip 8< ----
#!/usr/bin/perl
use strict;
use XML::Mini::Document;
use Data::Dumper;
my $content = << 'EndOfXML';
<?xml version = "1.0" encoding = "UTF-8"?>
<location>307.76/ROB\</location>
EndOfXML
print "Content:\n$content\n\n";
my $xmlDoc = XML::Mini::Document->new();
$xmlDoc->parse($content);
my $xmlHash = $xmlDoc->toHash();
print Dumper($xmlHash);
---- 8< snip snip 8< ----
This has been distilled from a production system that died because Perl
ended up eating all the virtual memory available!
I've noticed that if I put in:
$XML::Mini::Document::TextBalancedAvailable = 0;
between the creation of the $xmlDoc object and the parse, the system works
correctly, so it looks like it might be a problem in the fromSubStringBT()
internal subroutine in XML::Mini::Document.