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,ae395e5c11de7bc9 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nntp.club.cc.cmu.edu!micro-heart-of-gold.mit.edu!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: segfault with large-ish array with GNAT Date: Thu, 18 Mar 2010 19:57:13 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <642ddf8b-1d45-4f74-83ad-2c755040ca33@k24g2000pro.googlegroups.com> <4ba13454$0$6720$9b4e6d93@newsspool2.arcor-online.net> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1268956620 2194 192.74.137.71 (18 Mar 2010 23:57:00 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Thu, 18 Mar 2010 23:57:00 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:Vr5PdCULrJgjnuX6VkTJUmueuuE= Xref: g2news1.google.com comp.lang.ada:9658 Date: 2010-03-18T19:57:13-04:00 List-Id: Ludovic Brenta writes: > Jerry wrote on comp.lang.ada: >> I would have thought that Ada (or GNAT >> specifically) would be smart enough to allocate memory for large >> objects such as my long array in a transparent way so that I don't >> have to worry about it, thus (in the Ada spirit) making it harder to >> screw up. (Like not having to worry about whether arguments to >> subprograms are passed by value or by reference--it just happens.) > > So, you would like the Ada run-time to bypass the operating system- > enforced, administrator-approved stack limit? If userspace programs > could do that, what would be the point of having a stack limit in the > first place? Well, yeah, but what IS the point of having a stack limit in the first place? As opposed to a limit on virtual memory use, whether it be stack or heap or whatever. It's useful to limit a process to a certain amount of virtual address space. It prevents that process from hogging the whole system. And it prevents infinite-recursion bugs from causing thrashing. And it prevents infinite-"new" bugs from causing the same. It seems to me, a process should be allowed to allocate its memory however it likes. If it is allowed to allocate (say) 2 gigabytes of address space, then it should be allowed to allocate (say) half of that to the main thread's stack, if it likes. - Bob