xalan-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincent Lefevre (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (XALANC-752) Recursive xsl:call-template exhausts memory
Date Mon, 14 Oct 2013 14:41:43 GMT

    [ https://issues.apache.org/jira/browse/XALANC-752?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13794156#comment-13794156
] 

Vincent Lefevre commented on XALANC-752:
----------------------------------------

It seems that libxslt's method is just a heuristic based on the recursion depth, which is
needed anyway to also avoid finite but huge recursion depth. The default maximum depth is
3000, but can be changed by the user, either via the API or via the --maxdepth option for
the xsltproc command.

The choice for the default is rather arbitrary, as the best choice would depend on the environment,
but the fact that it is just a default and is configurable is sufficient.

More generally, XalanC could also provide an option to limit memory usage, possibly as a percentage
of physical memory, as the xz compressor/decompressor does.

> Recursive xsl:call-template exhausts memory
> -------------------------------------------
>
>                 Key: XALANC-752
>                 URL: https://issues.apache.org/jira/browse/XALANC-752
>             Project: XalanC
>          Issue Type: Bug
>          Components: XalanC
>    Affects Versions: 1.11
>         Environment: Debian GNU/Linux
>            Reporter: Bill Blough
>            Assignee: Steven J. Hathaway
>            Priority: Critical
>
> Forwarded from http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=718315
> When using the following template, recursion occurs in an unbounded fashion, eventually
exhausting all memory.
> $ cat test.xsl
> <xsl:stylesheet version="1.0"
>                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:template match="/" name="add">
>   <xsl:call-template name="add"/>
> </xsl:template>
> </xsl:stylesheet>
> To reproduce:
> $ TestXSLT -in test.xsl -xsl test.xsl
> The Xalan executable exhibits the same behavior.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xalan.apache.org
For additional commands, e-mail: dev-help@xalan.apache.org


Mime
View raw message