Re: [xml] Libxml 2.6.26 XML parsing bug

On Fri, Jul 07, 2006 at 02:22:41PM +0200, Kris Breuker wrote:
Good afternoon,

When I run the attached fotoarchief.xml file through xmllint.exe
(compiled from the libxml 2.6.26 sources) just by running

   xmllint.exe c:\temp\fotoarchief.xml

I get parser errors about a comment not being closed and mismatched 
starting and ending tags:

file:///c%3A/temp/fotoarchief.xml:537: parser error : Comment not 



annoying if I run the exact same test on my linux box using either libxml2
CVS checkout or the binary installed on the system I don't have any problem,
valgrind doesn't see any problem either, I'm afraid it's very dependant on
your system. What happen if you use Igor's precompiled binaries ?

paphio:~/XML -> xmllint --noout fotoarchief.xml
paphio:~/XML -> /usr/bin/xmllint --noout fotoarchief.xml
paphio:~/XML -> valgrind xmllint --noout fotoarchief.xml
paphio:~/XML -> md5sum fotoarchief.xml
5eb8ec29c960c5b7cb53df6b6dfa2a84  fotoarchief.xml
paphio:~/XML ->

If I add or delete a space, newline or some other content _before_ line 
535, the file is correctly parsed. It looks like a bug in libxml (maybe 
something with internal buffering of the XML file?).

 yes it looks like a buffering error, strangely since you don't
have an xmlDecl with an encoding stated, libxml2 expect the input to
be UTF-8 so there is not that extra buffering layer introduced by 
the encoding conversion. Check in a debugger for things like
ctxt->input->base, ctxt->input->cur and potential overflows there,
it's weird...


Daniel Veillard      | Red Hat
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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