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.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM, TO_NO_BRKTS_PCNT autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,174ca8cf9b3c1596,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!news1.google.com!news.germany.com!newsfeed01.sul.t-online.de!newsfeed00.sul.t-online.de!t-online.de!tiscali!newsfeed1.ip.tiscali.net!proxad.net!cleanfeed1-a.proxad.net!nnrp15-2.free.fr!not-for-mail Message-ID: <45b3f4a4$0$30117$426a74cc@news.free.fr> From: Yves Bailly Subject: Help: program won't ends (GNAT) Newsgroups: comp.lang.ada Date: Mon, 22 Jan 2007 00:17:50 +0100 User-Agent: KNode/0.10.4 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit Organization: Guest of ProXad - France NNTP-Posting-Date: 22 Jan 2007 00:17:56 MET NNTP-Posting-Host: 81.56.171.53 X-Trace: 1169421476 news-1.free.fr 30117 81.56.171.53:38789 X-Complaints-To: abuse@proxad.net Xref: g2news2.google.com comp.lang.ada:8386 Date: 2007-01-22T00:17:56+01:00 List-Id: Hello all, I'm a bit confused by the following behaviour. Please consider this simple program (a much larger one reduced to its minimum): ---8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-- with Ada.Text_IO; use Ada.Text_IO; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; procedure Bug is type A_1 is array(1..1) of Unbounded_String; type A_2 is array(1..1) of A_1; type Rec is record f: A_2 := (others => (others => Null_Unbounded_String)); end record; var: Rec; begin Put_Line("START"); Put_Line("END"); end Bug; ---8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-- When I run the program, both strings are displayed, but the program doesn't exit: it just keeps running, eating 75% of my CPU power. Playing a little bit with a debugger (I'm an absolute newbe with gnat_gdb), it seems I'm looping into a "bug__clean" function, more precisely somewhere in "system__finalization_implementation__finalize_list" or "system__finalization_implementation__finalize". Compiled by GNAT-2006 (the latest release) or by the GNAT provided with GCC 4.1, both give the same behaviour. If I change the "A_2" in the record for "A_1", then everything works fine. If I remove the aggregate to initialize the "f" component, then everything works fine. What's wrong with my code ? Is it a GNAT bug ? Any hint or workaround would be much appreciated. Regards, -- (o< | Yves Bailly : http://kafka-fr.net | -o) //\ | Linux Dijon : http://www.coagul.org | //\ \_/ | | \_/`