comp.lang.ada
 help / color / mirror / Atom feed
From: "Marc A. Criley" <mcqada@earthlink.net>
Subject: Re: Stack size with GNAT for Windows
Date: Wed, 11 Apr 2001 12:05:41 GMT
Date: 2001-04-11T12:05:41+00:00	[thread overview]
Message-ID: <3AD43B2E.D5623C8D@earthlink.net> (raw)
In-Reply-To: mailman.986905151.26576.comp.lang.ada@ada.eu.org

gautier@club.lemonde.fr wrote:
> 
> Hello. Sorry for the banal question, but is there
> a mean to increase the stack size with GNAT (3.13p)
> for Windows ? I obtain a stack overflow in a numerics
> program for a middle-sized problem, with all big data
> taken on heap (via New), this when entering a procedure
> with only 3 integer as local variables. So, I suspect
> a bug, but would like to test a bit before sending a bug
> report. Of course I have searched through the GNAT user's
> guide and what remains of Deja News.

With only 3 integer local variables, it would seem stack size is only
part of the story.  I ran into a similar problem, though, with the 3.13
series (a, b1, b2) of GNAT on HP-UX.  The characteristics of the
procedures in which the problem occurred usually involved either large
aggregate assignements (meaning the data item itself was quite large) or
calling a function whose return type was a large data structure.

Presumably the stack is employed as an intermediary when doing these
assignments, and so caused the overflow.

This problem was reported to ACT, as we were a supported customer, and I
_believe_ fixes went into the 3.14 series, of which there is not yet a
public version.

In the meantime, if your procedure does show characteristics like I
described, the way we worked around the problems was by breaking large
aggregate assignments into a series of component assignments, and by
converting the functions into procedures that returned data via an "out"
or "in out" parameter.

On the other hand, if your procedure doesn't have those characteristics,
analyze it to see what other kind of construct may be in it that might
reasonably be expected to require a large amount of intermediate
storage.

Good luck,

Marc A. Criley
Senior Staff Engineer
Quadrus Corporation
www.quadruscorp.com



  reply	other threads:[~2001-04-11 12:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-10 12:19 Stack size with GNAT for Windows gautier
2001-04-11 12:05 ` Marc A. Criley [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-04-14 20:30 gautier
replies disabled

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