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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,86f12c6cc81fafe X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Alex R. Mosteo" Newsgroups: comp.lang.ada Subject: Re: exception access violation Date: Wed, 15 Nov 2006 10:58:09 +0100 Message-ID: <4s06i8FsekphU1@mid.individual.net> References: <1163446297.630444.280740@b28g2000cwb.googlegroups.com> <4rtfa8FsioqkU1@mid.individual.net> <1163532883.352177.211940@m73g2000cwd.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: individual.net N49CKNrznIrqAZPnt8y6yAUph44WqzsTzxiv/VBsg/Y/ob6oY= User-Agent: KNode/0.10.4 Xref: g2news2.google.com comp.lang.ada:7467 Date: 2006-11-15T10:58:09+01:00 List-Id: Jade wrote: > I shuffled around my code and the error is now > > Exception Name => STORAGE_ERROR > Exception Message => stack overflow (or erroneous memory access) Stack size is an OS matter, so you must tell gnatlink the parameters that will go to the system linker. There are a few threads discussing how to do this with GNAT that you'll easily find in google groups, at least one is recent. However, if you're managing large data structures (over 4MB in size), I'd go for a heap-based solution using controlled types. In my experience, abusing the stack is a source of headaches sooner or later (specially if you are doing something portable). Note that ill-managed recursivity can also be a source of stack overflows, and you can check this in GNAT with -fstack-check. Without it, stack overflows are sometimes reported as violations instead. Regards, Alex.