Re: [xslt] crash in libxslt 1.0.9
- From: Daniel Veillard <veillard redhat com>
- To: xslt gnome org
- Subject: Re: [xslt] crash in libxslt 1.0.9
- Date: Thu, 7 Mar 2002 13:25:38 -0500
On Wed, Mar 06, 2002 at 03:36:08PM -0700, Vakoc, Mark wrote:
> Ok, I can duplicate it now on my system (using 2.4.16 and 1.0.12), hopefully
> you can too :)
> Included are two stylesheets and a src document, simply run
> xsltproc style.xsl src.doc
> In style.xsl you will notice two 'copys' of the same functionality. If you
> comment out the second instance, it won't crash. This leads me to believe
> that something is freeing the namespace stuff after the first instance,
> causing the second instance to use the invalid strings..
I think the problem is called "dynamic code generation".
Basically exslt:function now allows to dynamically extend the XSLT
code at run-time. Everything looked fine because the new document
were also kept in the document list which is kept im memory till the
end of the processing.
However in the failing case it seems the exslt:function new code is
built from a volatile copy of a global variable. So basically when the
variable is deallocated some part needed for the processing of the
code have disapeared, are deallocated and points to random data :-(
The solution is to build a copy of the tree and process the code
"compilation" from the copy of that tree and keep it as part of the
extension function data. I will try to do this before the next release
and hope it fixes the problem.
Daniel Veillard | Red Hat Network https://rhn.redhat.com/
firstname.lastname@example.org | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
] [Thread Prev