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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ab4f67f984ef04f9 X-Google-Attributes: gid103376,public Path: controlnews3.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsmm00.sul.t-online.de!t-online.de!news.t-online.com!not-for-mail From: Martin Krischik Newsgroups: comp.lang.ada Subject: Re: Is the Ada run-time required to detect out-of-memory Date: Wed, 26 May 2004 09:09:50 +0200 Organization: AdaCL Message-ID: <1258309.UlGiJVGX7P@linux1.krischik.com> References: <878yfmiuak.fsf@insalien.org> <2h7b84Fa2aefU1@uni-berlin.de> <87n041l9mv.fsf@insalien.org> Reply-To: krischik@users.sourceforge.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: news.t-online.com 1085556424 00 561 8tKMGzNOHoF3jUf 040526 07:27:04 X-Complaints-To: usenet-abuse@t-online.de X-ID: ZRWdO+ZUYepBsMlGdicSuasvLy1Fl9ZK0Ozcc8y3CFZ30J8j2Kt5ZS User-Agent: KNode/0.7.7 Xref: controlnews3.google.com comp.lang.ada:839 Date: 2004-05-26T09:09:50+02:00 List-Id: Robert I. Eachus wrote: > Ludovic Brenta wrote: > >> I just closed your bug report after determining that the issue was not >> in libgnat but in the kernel. Basically, Linux sends SIGKILL to >> programs that exhaust physical RAM; as you know, SIGKILL cannot be >> caught so libgnat has no chance to raise an exception. If the virtual >> memory is exhausted before physical memory is, then libgnat does raise >> Storage_Error. > > Did you refile the bug against the kernel? As I understand it now, the > problem is not that the kernel raises SIGKILL if physical RAM is > exhausted, but that malloc doesn't check that the allocation can succeed > before making it. one could use calloc. calloc zeros memory and therefore touches every page. BTW It's not a bug its a feature: /work Linux martin@linux2 Mi Mai 26 08:09:24 standart >man malloc [....] Linux follows an optimistic memory allocation strategy. This means that when malloc() returns non-NULL there is no guarantee that the memory really is available. In case it turns out that the system is out of memory, one or more processes will be killed by the infamous OOM killer. GNU 1993-04-04 MALLOC(3) Manual page malloc(3) line 37/72 (END) With Regards Martin -- mailto://krischik@users.sourceforge.net http://www.ada.krischik.com