Re: [xml] Bug or User Error



On Thu, Jan 29, 2004 at 10:37:42PM -0500, Ron Ohmer wrote:
Well as I stated below, the rant Daniel went on below was not helpful, and off target..

  You indicated you called 4 functions in a loop.
And it's clear from the documentation that one of those function is 
a library wide cleanup which destroys the library state. 

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.

  I test, as part of the regression tests loop of calls, there are many many
users where libxml2 is deployed and repeatedly parse thousands of XML
files, with no leak. I have no idea why you have a problem, you say
there is a memory error, did you try to debug the memory state with
the informations provided about this ?
    From top page 
    http://xmlsoft.org/
    Developper menu
    http://xmlsoft.org/docs.html
    Memory management
    http://xmlsoft.org/xmlmem.html
    4/ debugging routines
    http://xmlsoft.org/xmlmem.html#Debug

"When configured using --with-mem-debug flag (off by default), libxml2
uses a set of memory allocation debugging routines keeping track of
all allocated blocks and the location in the code where the routine was
called. A couple of other debugging routines allow to dump the memory
allocated infos to a file or call a specific routine when a given block
number is allocated..."

  So what, did you tried this ?

And on the "Why bother building docs" tirade.  The documentation
website is rather hard to navigate.  It takes some time to find what one
iing --with-mem-debug flag (off by default), libxml2 uses a set of memory allocation debugging routines 
keeping track of all allocated blocks and the location in the code where the routine was called. A couple 
of other debugging routines allow to dump the memory allocated infos to a file or call a specific routine 
when a given block number is allocated looking for.  I am not really sure how you got to the doc below that
you are mentioning.

  There is a search engine box on all the pages on the site (except a couple)
you knew the function name, simply putting the function name in the search 
box would bring back relevant informations, and if you selected "API only"
results in the search page you get a single link to the documentation
of teh function you were interested in.
  Now can you explain me how this is "hard" and how to make it "easier"
to find said information ??? Be constructive !

I added the xmlCleanupParser based upon an example
that I saw while I was waiting for an answer from the mailing list.

  What example ? Pointer please ! It should be clear that this is a 
library cleanup function.

  I'm sorry, I still think the approach of dropping half backed code
on the mailing list to ask for debug, without giving clear informations
and just expecting others to spend the time to debug your code is not
friendly. At least checking the documentation for the functions used 
sounds a bare minimum, and I have a hard time accepting your "finding
the documentation for said functions is too hard" answer, no that doesn't
fly. Maybe I overreacted, but when after cleaning up the thousands of
bounce messages, finding mostly this kind of traffic in the mailing-list
is depressing. I feel good about offering free software and documentation
to whoever wants to use them, I feel bad when I have the impression I'm
just used as free labour for people who just don't want to take the time
to learn about the gift I'm making and just want their job done for free.
  If your feedback allows to improve the project for everybody, then
it's a global contribution and very welcome, if it's just "here is my code
I don't understand what it does", well it's just a selfish request, which
sometime is fine because in the end the project benefit from a bug fix, 
but most of the time this is just a misunderstanding of the library, and
from your second post it was just looking like you tried calling the
functions in different ways without really trying to understand what
those functions were actually doing.
  So yes, I overreacted, but still I tend to think you didn't took the
time to analyse the problem and found it simpler to just drop it onto
the mailing-list, maybe I'm just wrong and it's bad on my part, sorry then.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



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