Re: [xml] Bug or User Error



Ron Ohmer wrote:

Well as I stated below, the rant Daniel went on below was not helpful, and off target..

I changed the way the code works, so that doc=xmlParseFile is only called once.

Now it seems to function.  This still is either and error in the documentation (Unlikely) or the xmlParseFile 
is not properly functioning.  Each time I called xmlParseFile, I also called xmlFreeDoc, therefore there 
should be no problem calling it 3000 times, let alone 6.

And on the "Why bother building docs" tirade.  The documentation website is rather hard to navigate.  It 
takes some time to find what one is looking for.  I am not really sure how you got to the doc below that you are 
mentioning.  I added the xmlCleanupParser based upon an example that I saw while I was waiting for an answer from the 
mailing list.

Ron

Now docs or not, you haven't debugged. You said that there is a leak and haven't provided a slightest bit of useful information which could have helped to identify the leak.

Noone will debug anything for you unless paid to do so. Not even if the error indeed is in libxml. It works for us, it passes our tests. You will have to run the debugger and identify the error exactly, possibly fixing it on the way.

If you try that and fail, then you must provide the code which can reproduce the error and we will debug it, if we suspect an error in libxml.

Just to remove that last possibility, I have compiled and run this:

  #include <stdio.h>
  #include <libxml/parser.h>
  int main(int argc, char** argv)
  {
    xmlDocPtr doc;
    xmlDocPtr doc2;
    while (1) {
      doc = xmlParseFile("./test.xml");
      doc2 = xmlParseFile("./test2.xml");
      if (doc == NULL || doc2 == NULL)
        break;
      xmlFreeDoc(doc);
      xmlFreeDoc(doc2);
    }
    return 0;
  }

Still it runs, no exceptions, no leaks.

Ciao,
Igor




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]