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

Re: [xml] valgrind errrors with this small sample program



On Wed, Mar 10, 2004 at 03:56:12PM +0100, Holger Rauch wrote:
> Hello!
> 
> The following sample program (uses xmlParseMemory() to parse an XML
> document) causes many errors in valgrind to appear. I used the latest libxml2
> version (2.6.7) compiled from source on a Debian 3.0 "Woody" system (kernel
> 2.4.23, glibc 2.2.5, gcc 2.95.4). The same example works without any problems
> for other XML documents. Could anybody please tell me whether this is a bug
> or not? (I'm kind of puzzled. The document is output correctly by
> xmlDocDump(), though. But the valgrind errors seem somewhat serious to me.)
> 
> The output from valgrind is attached in gzip format.
> 
> Thanks in advance for any info on this issue!

  Damn, a very ugly corner case where I forgot a check :-(
Patch enclosed, it will hit CVS very soon ! I will add the test to
the regressions.
Thanks a lot for reporting this,

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/
Index: parser.c
===================================================================
RCS file: /cvs/gnome/gnome-xml/parser.c,v
retrieving revision 1.362
diff -u -r1.362 parser.c
--- parser.c	25 Feb 2004 10:44:29 -0000	1.362
+++ parser.c	10 Mar 2004 16:11:29 -0000
@@ -7320,6 +7322,7 @@
 		    if (nsPush(ctxt, attname, URL) > 0) nbNs++;
 		if (alloc != 0) xmlFree(attvalue);
 		SKIP_BLANKS;
+		if (ctxt->input->base != base) goto base_changed;
 		continue;
 	    }
 


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