ash parse tree and stack boundaries

Denys Vlasenko vda.linux at googlemail.com
Wed Dec 1 14:17:05 UTC 2010


On Mon, Nov 29, 2010 at 2:47 PM, Alexander Shishkin <virtuoso at slind.org> wrote:
> I'm
> thinking of how to go about solving it.
>
> 1) introduce recursion depth counter to all the eval*() functions; stack
> limits might differ, thus calculating the maximum depth might be tricky
> and error prone;

How that will help? Instead of a SEGV, you'd get an error message,
but it will still be a failure to execute a perfectly valid script.

> 2) install a SEGV handler; ugly;

And similarly to the above, doesn't solve the problem.

> 3) optimise evaltree() to iterate through similar nodes; won't help against
> large amounts of ":&&:;";
> 4) try to optimise the whole parser to get rid of recursion entirely;

This will fix the problem, but is hard to do.

> 5) switch to hush and be done with it (how good is it for a drop-in ash
> replacement)?

There are known ash features which aren't implemented in hush.
But overall, something like 90% or more is already there.
There are even things which work in hush but not in ash.

I am waiting for user reports on their experience and on what
are the most needed missing features.

-- 
vda


More information about the busybox mailing list