Uploaded image for project: 'Commons JEXL'
  1. Commons JEXL
  2. JEXL-274

Handle soft and hard stack overflow

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.1
    • 3.2
    • None

    Description

      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.

      Attachments

        Activity

          People

            henrib Henri Biestro
            henrib Henri Biestro
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: