bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-apl] Deep Nesting


From: Juergen Sauermann
Subject: Re: [Bug-apl] Deep Nesting
Date: Sun, 23 Aug 2015 13:41:57 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

Hi Elias,

thanks. Do you have any further details onm how to do that redzone stuff?

/// Jürgen


On 08/23/2015 10:53 AM, Elias Mårtenson wrote:
Normally you'd mark page on the stack as a redzone, triggering a segmentation fault when an attempt is made to access it. The signal handler can then determine that the redzone was reached, and throw the appropriate error when it happens.

That way you don't have to check the stack size on every call.

On 23 August 2015 at 11:11, Mike Duvos <address@hidden> wrote:
Hi Jürgen,

Maximum array depth is typically a system limit, like maximum rank.  Ideally, there shouldn't be anything you can type in which will cause the system to barf, but I can understand you not wishing to incur additional overhead.

This isn't something working code is going to want to do, so I guess it matters little if it gets checked or not.

Just thought I'd mention it.

Regards,

Mike



On Sat, Aug 22, 2015 at 1:31 PM, Juergen Sauermann <address@hidden> wrote:
Hi Mike,

your function NEST creates an extremely deep  process call stack when
enclosing extremely deeply nested values (proportional to the nesting depth).

Your operating limits the size of your call stack in order to protect
other processes against programming faults (or extremely unreasonable
programs which are difficult to distinguish from programming faults).

If you really want (actually you dont - believe me) your function to succeed,
then you should lift the default limit of your GNU/Linux like this:

ulimit -s unlimited   # no limit on the stack size

After that, GNU APL says:

      ≡10 NEST 0
1024
      ≡17 NEST 0
131072


In theory one could check or limit the nesting depth of a value in GNU APL,
but the run-time overhead would be significant.

/// Jürgen


On 08/19/2015 11:57 PM, Mike Duvos wrote:

      ∇NEST[⎕]∇
    ∇
[0]   Z←N NEST X;I
[1]   Z←X
[2]   I←¯1
[3]  L1:→((I←I+1)≥N)/0
[4]   (∊Z)←⊂,Z
[5]   →L1
    ∇

      ≡10 NEST 0
1024
      ≡15 NEST 0
32768
      ≡16 NEST 0
65536
      ≡17 NEST 0
Bus error (core dumped)
address@hidden:~$





reply via email to

[Prev in Thread] Current Thread [Next in Thread]