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: 103376,4dfbb9c23c9a83eb X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!hwmnpeer01.lga!hwmedia!news-server.columbus.rr.com!tornado.ohiordc.rr.com.POSTED!53ab2750!not-for-mail From: "John B. Matthews" Newsgroups: comp.lang.ada Subject: Re: How to set the stack size on GNAT (Follow-up) References: <27c5ecc06ac6a213466ab65361d20376@localhost.talkaboutprogramming.com> <2db7e95053c018032e212a9f7c2c614d@localhost.talkaboutprogramming.com> User-Agent: MT-NewsWatcher/3.4 (PPC Mac OS X) Message-ID: Date: Sun, 07 Aug 2005 15:31:21 GMT NNTP-Posting-Host: 65.31.62.213 X-Complaints-To: abuse@rr.com X-Trace: tornado.ohiordc.rr.com 1123428681 65.31.62.213 (Sun, 07 Aug 2005 11:31:21 EDT) NNTP-Posting-Date: Sun, 07 Aug 2005 11:31:21 EDT Organization: Road Runner High Speed Online http://www.rr.com Xref: g2news1.google.com comp.lang.ada:4018 Date: 2005-08-07T15:31:21+00:00 List-Id: In article <2db7e95053c018032e212a9f7c2c614d@localhost.talkaboutprogramming.com>, "Adaddict" wrote: > 2. -Xlstack=10485760 I think I proposed this one. It worked with GNAT 3.15 on Mac OS 9 with MachTen or CodeBuilder. IIRC, the default stack size was just a few kilobytes, so adjusting the stack size was sometimes hard to avoid. > Could anyone tell me what am I doing wrong and what > should I write exactly? On Mac OS X, this should set the stack to 8 megabytes (the default): gnatmake -f stack_test -largs --stack=0x800000 But you have to set "ulimit -s " in the shell to make it work: $ ulimit -s 8192 Here's my test program: with Ada.Text_IO; procedure Stack_Test is Megabyte : constant Positive := 1024 * 1024; type Block is array (0 .. Megabyte - 1) of Character; procedure Allocate_Stack (N : Positive) is Local : Block := (others => Character'Val(0)); begin Ada.Text_IO.Put_Line (N'Img); Allocate_Stack(N + 1); end; begin Allocate_Stack(1); end Stack_Test; By default, the program dies after seven levels of recursion, as expected. With "ulimit -s 16384" I get 15 levels before segmentation fault. What OS are you using? -- John jmatthews at wright dot edu www dot wright dot edu/~john.matthews/