From: Yves Bailly <kafka.fr@laposte.net>
Subject: Help: program won't ends (GNAT)
Date: Mon, 22 Jan 2007 00:17:50 +0100
Date: 2007-01-22T00:17:56+01:00 [thread overview]
Message-ID: <45b3f4a4$0$30117$426a74cc@news.free.fr> (raw)
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 | //\
\_/ | | \_/`
next reply other threads:[~2007-01-21 23:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-21 23:17 Yves Bailly [this message]
2007-01-22 8:14 ` Help: program won't ends (GNAT) Niklas Holsti
2007-01-22 10:54 ` Georg Bauhaus
2007-01-22 19:25 ` Yves Bailly
2007-01-23 19:05 ` Björn Persson
2007-01-25 0:44 ` Jeffrey Creem
2007-01-22 9:51 ` Brian May
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox