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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,bf2571446148ae30 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.204.156.205 with SMTP id y13mr111673bkw.3.1325769954160; Thu, 05 Jan 2012 05:25:54 -0800 (PST) Path: cj8ni50739bkb.0!nntp.google.com!news1.google.com!postnews.google.com!a11g2000vbz.googlegroups.com!not-for-mail From: Mark Lorenzen Newsgroups: comp.lang.ada Subject: Re: Can't set executable stack size during compilation Date: Thu, 5 Jan 2012 05:20:21 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <4f047e0f$0$6582$9b4e6d93@newsspool3.arcor-online.net> NNTP-Posting-Host: 193.163.1.105 Mime-Version: 1.0 X-Trace: posting.google.com 1325769953 8654 127.0.0.1 (5 Jan 2012 13:25:53 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 5 Jan 2012 13:25:53 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: a11g2000vbz.googlegroups.com; posting-host=193.163.1.105; posting-account=Srm5lQoAAAAEMX9rv2ilEKR6FDPapmSq User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HUALESNKRC X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20100101 Firefox/8.0,gzip(gfe) Content-Type: text/plain; charset=ISO-8859-1 Date: 2012-01-05T05:20:21-08:00 List-Id: On 4 Jan., 17:27, Georg Bauhaus wrote: > [...] > FWIW, I made a little test program; I think it is legal > but it crashes consistently when translated with GNAT/GCC. > With -fstack-check given, the most unexpected thing to see is a > segmentation fault! If the environment task uses too much stack space, it may not be possible to raise an exception or unwind the raised exception (i don't know which). Probably because raising or unwinding an exception uses some stack space itself. See http://www.adacore.com/wp-content/files/auto_update/gnat-unw-docs/html/gnat_ugn_24.html [QUOTE] For the environment task, the stack size depends on system defaults and is unknown to the compiler. Stack checking may still work correctly if a fixed size stack is allocated, but this cannot be guaranteed. To ensure that a clean exception is signalled for stack overflow, set the environment variable GNAT_STACK_LIMIT to indicate the maximum stack area that can be used, as in: SET GNAT_STACK_LIMIT 1600 The limit is given in kilobytes, so the above declaration would set the stack limit of the environment task to 1.6 megabytes. Note that the only purpose of this usage is to limit the amount of stack used by the environment task. If it is necessary to increase the amount of stack for the environment task, then this is an operating systems issue, and must be addressed with the appropriate operating systems commands. [/QUOTE] Best Regards, Mark L