You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Henri Biestro (Jira)" <ji...@apache.org> on 2021/06/07 13:15:07 UTC

[jira] [Closed] (JEXL-274) Handle soft and hard stack overflow

     [ https://issues.apache.org/jira/browse/JEXL-274?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Biestro closed JEXL-274.
------------------------------

> Handle soft and hard stack overflow
> -----------------------------------
>
>                 Key: JEXL-274
>                 URL: https://issues.apache.org/jira/browse/JEXL-274
>             Project: Commons JEXL
>          Issue Type: Improvement
>    Affects Versions: 3.1
>            Reporter: Henri Biestro
>            Assignee: Henri Biestro
>            Priority: Major
>             Fix For: 3.2
>
>
> WHAT:
> Since JEXL allows recursion, it would be convenient to stop execution early when running towards a stack overflow. In general, scripts don't have much use for recursion so this would be a good (soft) safeguard.
> Incidentally, when a function called by a script ends up in a stack overflow, it would be nice to catch it and properly propagate it through a JexlException.
> HOW:
> Introduce a new JexlException subclass (StackOverflow) that can be thrown after catching a (JVM) StackOverflow in Interpreter.interpret().
> The StackOverflow soft limit -ie one that pertains to JEXL only - requires a new JexlBuilder option (stackOverflow(size)) and a way to count the stack 'height'; easiest/safest seems to put interpreter instance in TLS and increment/check a 'frame pointer' member.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)