Invenzzia »

Open Power Template 2.x family
Tasklist

FS#2 - Fatal error: Nesting level too deep - recursive dependency?

Attached to Project: Open Power Template 2.x
Opened by Anonymous Submitter - Monday, 31 March 2008, 13:51 GMT-7
Last edited by Zyx (Zyx) - Monday, 11 August 2008, 05:18 GMT-7
Task Type Bug Report
Category Template compiler
Status Closed
Assigned To No-one
Operating System Windows
Severity High
Priority Normal
Reported Version 2.0.0-dev1
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

I've run test_foreach_1.php example from /dev/ category. OPT 2 cannot compile this template because of too deep object nesting level. Perhaps, it's PHP related bug but consider optimizing OPT 2 compiler.

Screenshot: http://www.imagic.pl/public/pview/127252/optbug.png

Doesn't OPT 2's compiler use so much memory?
This task depends upon

Closed by  Zyx (Zyx)
Monday, 11 August 2008, 05:18 GMT-7
Reason for closing:  Outdated
Additional comments about closing:  Research:
- some of those messages appeared because of bug in PHP 5.2.x itself. It was fixed in one of the newest versions.
- on SVN, the compiler does not use direct recursion anymore.
Comment by Zyx (Zyx) - Wednesday, 02 April 2008, 11:06 GMT-7
In this particular place I surely would, but it is impossible. The node tree depth that OPT is able to compile is strictly connected with the nesting level limit set in PHP. The node compilation has to be done with a recursion, because the instruction processors must be able to call the subnode processing in any moment and to get the results at the same time. In any other place I remove the recursion by replacing the algorithms with their imperative versions and this has already been started. However, without an access to the low-level programming, this one particular algorithm seems to be impossible to implement in this way.

In fact, the DEFAULT nesting level limit set by PHP should be more than enough for any template. Your limit is four times lower (only 16 - this may not be enough for many other scripts). So my answer is clear... enlarge your limit at least to the default value. I wish I could write a template engine with all this features that consumes no processor time, stack, memory etc. but you know... :)

When it comes to the memory - this will be also optimized in the future (but still before the final release), but the return to the amounts from OPTv1 will be possible only with the quirks mode enabled. I must do some real tests first.

Loading...