GNOME Bugzilla – Bug 318088
Infinite loop not detected
Last modified: 2006-07-14 16:27:57 UTC
Please describe the problem: I apply a XSLT stylesheet with an infinite recursion and the infinite loop is not detected. Any value I set for --maxdepth is ignored. Steps to reproduce: 1. Create the maxDepth.xsl file in the same directory as xsltproc.exe. maxDepth.xsl contains: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:call-template name="temp"/> </xsl:template> <xsl:template name="temp"> <xsl:call-template name="temp"/> </xsl:template> </xsl:stylesheet> 2. Apply maxDepth.xsl on any XML file with a command line like: xsltproc --verbose --maxdepth 100 maxDepth.xsl samples\personal.xml Actual results: The template "temp" is called in an infinite loop. Expected results: Receive a message like "xsltApplyOneTemplate: loop found ??? try increasing xsltMaxDepth (--maxdepth)" Does this happen every time? Yes Other information: No
Does anyone check the libxslt bug reports submitted to the GNOME bugzilla ?
yes when I have time, same for others. Bugzilla means it's in stable storage and it won't get lost. you could try the latest 1.1.15, but I doubt it would change the result, apparently there is a test missing, it does not look like critically urgent nor hard and will certainly be fixed before next release. Daniel
When xsltApplyOneTemplateInt is called with notcur=1, then templPush and tempPop are not called, so templNr is never increased, so templNr never becomes greater than xsltMaxDepth, thereby allowing infinite recursion. Maybe caused by the modification for bug 157859.
I'm a bit behind on bug hunting, but since it's in bugzilla this will be processed, bear with me, the issue is not lost :-) Daniel
This has just occurred to me. Any news?
Yes, this issue is currently being processed. I'll modify the changes made due to bug 157859 and introduce an other field on xsltTemplate to reflect the "current template rule", in order to have the template stack reserved for internal processing - like the counting of nested template calls.
*** Bug 327470 has been marked as a duplicate of this bug. ***
Whoops, correction: the new field goes into xsltTransformContext, not xsltTemplate.
Fixed in CVS HEAD. I reduced the default maxdepth from 5000 to 3000, since this scenario runs out of memory after about 3800 recursions on my win. Set back to 5000 if that's a problem.