Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] Removed arbitrary limitations on array accesses



2010/1/6 Duncan Sinclair <duncan.sinclair@xxxxxxxxxxxxxxxx>:
>
> On 5 Jan 2010, at 9:48 am, Peter Stephenson wrote:
>
>> On Mon,  4 Jan 2010 20:38:17 -0500
>> Michael Hwang <michael.a.hwang@xxxxxxxxx> wrote:
>>>
>>> This issue was brought up on IRC. It appears that while there is no limit
>>> on
>>> how many array elements can be stored, there is a limit to how many can
>>> be
>>> accessed. This patch removes these limits.
>>
>> Those have been there for a long time.  I don't have any evidence that
>> they're doing a lot of good but we have had people creating positional
>> parameters with <long_number>=something and wondering why it uses a lot of
>> memory.  I suppose this is similar.  The arbitrary limit is not very
>> useful and also undocumented; most people wouldn't miss it if it wasn't
>> there, certainly.
>
> IIRC, the problem was that is you typed a big number at the zsh prompt and
> hit tab, the shell would either hang for a long time or crash (out of
> memory).
>
> % 99999999999<tab>
>
> I reported this as a bug â the shell should not crash so easily.
>
> There is probably a way of preventing this problem though without putting
> arbitrary limits on the size of array indices.

There are other similar ways you can crash a shell anyway,
alt-111111111111 1 and `yes` for example. I'm not sure if it's worth
trying to fix all of them.

-- 
Mikael Magnusson



Messages sorted by: Reverse Date, Date, Thread, Author