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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!newsfeed0.kamp.net!newsfeed.kamp.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: hreba Newsgroups: comp.lang.ada Subject: Re: storage error: stack overflow Date: Mon, 17 Aug 2015 23:16:34 -0300 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net QPt1o05LGW7+kpyJX3gr6QysBErmaDjxzagZqBbnQGiC3/T7Gy Cancel-Lock: sha1:iB8CPRjM+o8QYQxeA5rGlu0n/9o= User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 In-Reply-To: Xref: news.eternal-september.org comp.lang.ada:27482 Date: 2015-08-17T23:16:34-03:00 List-Id: On 08/11/2015 06:53 PM, hreba wrote: > I am developing a program on 3 computers in parallel (depending on where > I am). On 2 of them the executable works as expected, on one I get: > > raised PROGRAM_ERROR ; adjust/finalize raised STORAGE_ERROR: stack > overflow (or erroneous memory access) > > The computers are: > > a) a 32 bit desktop PC running Windows 7 > b) a 32 bit desktop PC running LinuxMint release 13 > c) a 64 bit Notebook running LinuxMint release 17.1 > > It is machine c) which makes the trouble. > On each machine I compile the program (no warnings) with gnat/GPS. > > How can I find out what is wrong? Replying to my own post: With your help I was able to localize the error. Now I wrote a simple test program which behaves as the original one: runs on the machines a) and b) and provokes the error on c). Here it is: with Ada.Strings.Unbounded; procedure testUBS is type TA is record name: Ada.Strings.Unbounded.Unbounded_String; end record; type TB is record a: TA; end record; function New_TB (name: String:="") return access TB is begin return new TB' (a=>TA'(name=>Ada.Strings.Unbounded.To_Unbounded_String(name))); end New_TB; b: access TB:= New_TB (name=>"Det"); name: Ada.Strings.Unbounded.Unbounded_String; begin name:= b.a.name; end testUBS; -- Frank Hrebabetzky +55 / 48 / 3235 1106 Florianopolis, Brazil