From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,c550113251b19a6 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!news.glorb.com!feeder.erje.net!zen.net.uk!dedekind.zen.co.uk!aioe.org!not-for-mail From: Dennis Hoppe Newsgroups: comp.lang.ada Subject: Re: Error: "could not understand bounds information on packed array" Date: Fri, 29 May 2009 13:58:47 +0200 Organization: Aioe.org NNTP Server Message-ID: References: NNTP-Posting-Host: u2a4eF22+ozJM+GErK5hqg.user.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.7.9 Cancel-Lock: sha1:6cjXLYqhR4gJCHvAyUo6QVQJTeg= User-Agent: Postbox 1.0b12 (Macintosh/2009051120) Xref: g2news2.google.com comp.lang.ada:6098 Date: 2009-05-29T13:58:47+02:00 List-Id: Now, I am sure it is "just" a recursion issue. The following test terminates after just 87.354 iterations: with Ada.Text_IO; use Ada.Text_IO; procedure Testsuite is procedure Recursive_Call (Index : in out Integer) is begin Index := Index + 1; Ada.Text_IO.Put_Line (Integer'Image (Index)); Recursive_Call (Index); end Recursive_Call; begin declare I : Integer := 0; begin Recursive_Call (I); Ada.Text_IO.Put_Line (Integer'Image (I)); end; end Testsuite; Output: [..] 87354 raised STORAGE_ERROR : stack overflow Well, I didn't provide a suitable base case for termination. I just wanted do find out the upper bound of recursive calling. For me, 87.354 seems to be a very low upper bound of recursion. An adapted version in Java runs 519.045 recursion steps before a StackOverflowError occurs on the same machine. It is clear, that I cannot indefinitely call a procedure recursively. Unfortunately, I cannot predict in advance, how many recursion steps my program have to proceed. How can I avoid the stack overflow in recursion? Can I influence the upper bound of recursive calls, i.e the size of the run-time stack? Thank you, Dennis