← Back to team overview

zorba-coders team mailing list archive

[Bug 1027270] Re: parse-xml - endless 100%CPU with lots of character references

 

I did some brief debugging: the method FragmentXmlLoader::loadXml() goes
into an infinite loop with this input document. Specifically, when it
starts parsing the <template head="R..." element, it repeatedly gets to
line 332 in that file:

      if (theXQueryDiagnostics->errors().empty()
          &&
          theFragmentStream->current_offset == 0)
      {
        if (theFragmentStream->state == FragmentIStream::FRAGMENT_FIRST_START_DOC)
          FragmentXmlLoader::startDocument(theFragmentStream->ctxt->userData);
        xmlParseCharData(theFragmentStream->ctxt, 0);
        theFragmentStream->current_offset = getCurrentInputOffset(); // update current offset

And theFragmentStream->current_offset is set (again) to 0 at this point,
meaning it will get to the same point the next time through, and so on.

** Changed in: zorba
       Status: New => Confirmed

** Changed in: zorba
   Importance: Medium => Critical

** Changed in: zorba
    Milestone: None => 2.7

-- 
You received this bug notification because you are a member of Zorba
Coders, which is the registrant for Zorba.
https://bugs.launchpad.net/bugs/1027270

Title:
  xml:parse() - infinite loop

Status in Zorba - The XQuery Processor:
  Confirmed

Bug description:
  "xmllint wiki.xml" reveals that for some reason the input file contains lots of numeric character references (cat and vim decode those automatically).
  Strangely it doesn't seem to be only one character but a combination of lines that provokes the behaviour (I tried removing some lines individually but couldn't reproduce after that).

To manage notifications about this bug go to:
https://bugs.launchpad.net/zorba/+bug/1027270/+subscriptions


References