comp.lang.ada
 help / color / mirror / Atom feed
* Help: program won't ends (GNAT)
@ 2007-01-21 23:17 Yves Bailly
  2007-01-22  8:14 ` Niklas Holsti
  2007-01-22  9:51 ` Brian May
  0 siblings, 2 replies; 7+ messages in thread
From: Yves Bailly @ 2007-01-21 23:17 UTC (permalink / 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 | //\
\_/ |                                      | \_/`



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-01-25  0:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-21 23:17 Help: program won't ends (GNAT) Yves Bailly
2007-01-22  8:14 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox