Is the Ada run-time required to detect out-of-memory conditions?

From: Ludovic Brenta (ludovic.brenta_at_insalien.org)
Date: 05/21/04


Date: Fri, 21 May 2004 00:54:27 +0200

Hello,

I have received a bug report [1] against GNAT 3.15p and reproduced the
same behaviour with GCC 3.4. I would like the advice of language
lawyers on the issue.

[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=250076

The program allocates memory in an infinite loop using "new" and the
default storage pool, and of course exhausts all available storage.
The issue is whether or not Storage_Error should be raised. With
GNAT, no exception is raised; instead the program receives SIGKILL
(not even SIGSEGV) from Linux.

My first impression is that the program exhausts physical memory (RAM
+ swap) before exhausting the default storage pool, the size of which
is defined to be the total size of the virtual address space. As a
result, the kernel detects the out-of-memory condition before the Ada
run-time library does, and sends SIGKILL to the program. Of course,
the program has no chance to turn SIGKILL into an exception.

Is my assessment correct? Is this a bug in the GNAT library?

Thanks for any insight.

PS. The original reported says that the program receives SIGSEGV. He
uses Linux 2.4.22. I use 2.4.26 and the program receives SIGKILL
instead. I don't know if this is a known change in the kernel's
behaviour.

-- 
Ludovic Brenta.


Relevant Pages

  • ASIS and gnatelim : Will I make it work ?
    ... I try to work with gnatelim, and I faced a few problems ... ... - With gnat 3.15p on Windows, ... | Please submit bug report by email to ... ...
    (comp.lang.ada)
  • Re: A bug in Gnat, or in my code?
    ... It is fixed in the latest ACT version of GNAT ... Björn Persson wrote: ... > There is now a bug report in the GCC Bugzilla, ...
    (comp.lang.ada)
  • bug report being ignored
    ... gnat process/effort involved), but I filled a bug report for gnat on ... It is an annoying bug for me as it has an impact on gnatxref that I ...
    (comp.lang.ada)
  • Re: Configuring eclipse for Ada ?
    ... installations - and maybe I should fill a bug report in bugs.gentoo.org ... GNAT compilers. ... GNAT GPL 2006 also works in with gentoo GNAT. ...
    (comp.lang.ada)