comp.lang.ada
 help / color / mirror / Atom feed
* Stack overflow (or erroneous memory access)
@ 2001-11-07 11:39 Adrian Hoe
  2001-11-07 14:05 ` James Rogers
  0 siblings, 1 reply; 3+ messages in thread
From: Adrian Hoe @ 2001-11-07 11:39 UTC (permalink / raw)


I got an exception raised PROGRAM_ERROR : stack overflow (or erroneous
memory access) when I compiled the following code and executed it:

--------------------------------------------------------------
with Ada.Text_Io; use Ada.Text_Io;

procedure Test_Output is
   Buffer : String (1 .. 256);
   Len    : Natural;
   Output : File_Type;
begin
   Create (Output);

   Put_Line (Output, "Line #1");
   Put_Line (Output, "Line #2");
   Put_Line (Output, "Line #3");
   Put_Line (Output, "Line #4");
   Reset (Output, In_File);

   while not End_Of_File (Output) loop
      Get_Line (Output, Buffer, Len);

      if Len < Buffer'Length then
         Put_Line (Buffer (1 .. Len));
      else
         Put (Buffer);
      end if;
   end loop;

   Delete (Output);

end Test_Output;
---------------------------------------------------------------

The exception was raised at line 16: "while not End_Of_File (Output)
loop". I could not figure out the cause of this runtime error. Could
someone help?

I am using gnat-3.13p-7 (downloaded from gnuada.org for RH5.x) on
Caldera OpenLinux 2.3.

Thanks.



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

end of thread, other threads:[~2001-11-08  3:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-07 11:39 Stack overflow (or erroneous memory access) Adrian Hoe
2001-11-07 14:05 ` James Rogers
2001-11-08  3:12   ` Adrian Hoe

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