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-Thread: a07f3367d7,da39df064d0b18d7 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!news.glorb.com!news2.glorb.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!backlog2.nntp.dca.giganews.com!nntp.bt.com!news.bt.com.POSTED!not-for-mail NNTP-Posting-Date: Tue, 04 Aug 2009 06:55:22 -0500 From: Brian Drummond Newsgroups: comp.lang.ada Subject: Re: GNAT's stack checking in Ubuntu 9.04 (and Shootout regex-dna) Date: Tue, 04 Aug 2009 12:59:56 +0100 Reply-To: brian@shapes.demon.co.uk Message-ID: References: <4a776a94$0$31878$9b4e6d93@newsspool3.arcor-online.net> X-Newsreader: Forte Agent 1.7/32.534 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Usenet-Provider: http://www.giganews.com X-AuthenticatedUsername: NoAuthUser X-Trace: sv3-yzouU79Q7C84X+wdDulOj3w/2OOmgiitNBLskMv/41WyQYOC5cAMfedZz2M0PfLEbkMYUauDRppVX5m!vWgQzQJ0xGBU/xZooRL1KgzTEzKySw0EjScYVGLYjKNdHD8gn+etsI8F6WvQwuqsVUv3MUSJXMs5!Fw== X-Complaints-To: abuse@btinternet.com X-DMCA-Complaints-To: abuse@btinternet.com X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.39 X-Original-Bytes: 2616 Xref: g2news2.google.com comp.lang.ada:7565 Date: 2009-08-04T12:59:56+01:00 List-Id: On Tue, 04 Aug 2009 00:54:11 +0200, Georg Bauhaus wrote: >The GNAT that comes with Ubuntu 9.04 (GCC 4.3.3) >produces storage errors where GNAT on Debian Lenny >(GCC 4.3.2) and GNAT 2007 on Windows (4.3.1) don't. >This happens with larger data structures. > >The workaround is to introduce an indirection ... (.-) Default stack sizes may change between GCC versions and I've had trouble getting the stack size flags to work on some versions. I've done this too. What I don't like is having to change every use of the indirect variable, so I confine the changes to the declaration... >--- regexdna.gnat 6d8829eff6a278659ecb6ebc0f03672662de39b8 >+++ regexdna.gnat 09cbee8b34b6bc62a921d8bfc66e2f18cb57eeb6 >@@ -120,7 +120,8 @@ begin > Num_Lines := Num_Lines + 1; > end if; > declare >- Sequence_Lines : Dna_Lines(1..Num_Lines); >+ type Dna_Lines_Pointer is access Dna_Lines; -- avoids stack issues >+ -- Sequence_Lines : Dna_Lines_Pointer := new Dna_Lines(1..Num_Lines); Sequence_Lines_ptr : Dna_Lines_Pointer := new Dna_Lines(1..Num_Lines); Sequence_Lines : Dna_Lines(1..Num_Lines) renames Sequence_Lines_ptr.all; and now no changes are necessary to the program (which may access the variable many times) > Put(Item => Length(Sequence_Lines), Width => 1); - Brian