comp.lang.ada
 help / color / mirror / Atom feed
From: Mark Lorenzen <mark.lorenzen@gmail.com>
Subject: Re: Can't set executable stack size during compilation
Date: Thu, 5 Jan 2012 05:20:21 -0800 (PST)
Date: 2012-01-05T05:20:21-08:00	[thread overview]
Message-ID: <b3f50ee7-7b09-4871-b2f2-c0ca37c5461d@a11g2000vbz.googlegroups.com> (raw)
In-Reply-To: 4f047e0f$0$6582$9b4e6d93@newsspool3.arcor-online.net

On 4 Jan., 17:27, Georg Bauhaus <rm.dash-bauh...@futureapps.de> 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



  parent reply	other threads:[~2012-01-05 13:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-04 15:49 Can't set executable stack size during compilation Erich
2012-01-04 16:27 ` Georg Bauhaus
2012-01-04 17:22   ` Bill Findlay
2012-01-04 21:36     ` Georg Bauhaus
2012-01-05  1:06       ` Randy Brukardt
2012-01-05  4:35         ` Bill Findlay
2012-01-05 10:19           ` Georg Bauhaus
2012-01-05 12:35             ` Erich
2012-01-05  3:03   ` Jerry
2012-01-05 13:20   ` Mark Lorenzen [this message]
2012-01-05  3:12 ` Jerry
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox