From: karlran@hotmail.com (Karl Ran)
Subject: Howto debug seg-faulting Ada 95 code?
Date: 31 Aug 2002 00:58:24 -0700
Date: 2002-08-31T07:58:24+00:00 [thread overview]
Message-ID: <1f358d66.0208302358.6f1c6a39@posting.google.com> (raw)
Hello,
I've written this nice, but not very useful, Ada 95 program:
------------------------------------------------------------
with Ada; use Ada;
with Ada.Text_IO;
procedure segfault_city is
type Unsigned_8 is mod 2**8;
for Unsigned_8'Size use 8;
type Data is array( 0 .. 100 ) of Unsigned_8;
type block is array( 0 .. 200 ) of Data;
Buffers : array( 0 .. 310 ) of block;
task type fifo_Task
is
end fifo_Task;
My_fifo : fifo_Task;
task body fifo_Task
is
begin
Text_IO.Put_line("fifo_task ..");
end fifo_Task;
begin
Buffers( 0 )( 0 )( 0 ) := 0;
Text_IO.Put_line("Welcome to segfault city ..");
end Segfault_city;
------------------------------------------------------------
It compiles fine with gnat 3.14p( options: -gnatwa -gnato -g )
but it fails miserably when I run it.
It either seg-faults immediately or it eats up all memory and
gets killed. I tried it on P1, Celeron, P4 systems with
Linux 2.4.18/Suse7.1/8.0.
Some questions:
1. How do I debug seg-faults( this case and in general )?
2. Is this valid Ada 95 code?
3. Is this segfault-code 'portable' or are these just my, maybe, ill
configured systems?
Karl,
who is still using 'bleeding-edge' technology...
next reply other threads:[~2002-08-31 7:58 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-31 7:58 Karl Ran [this message]
2002-08-31 8:14 ` Howto debug seg-faulting Ada 95 code? Florian Weimer
2002-09-02 15:05 ` Karl Ran
2002-09-02 16:25 ` Jeffrey Creem
2002-09-02 16:47 ` Pat Rogers
2002-09-02 22:40 ` Jeffrey Creem
2002-09-02 23:25 ` Pat Rogers
2002-09-03 11:20 ` Jeffrey Creem
2002-09-04 14:57 ` Pat Rogers
2002-09-03 8:51 ` Sergey Koshcheyev
2002-09-03 11:42 ` Samuel Tardieu
2002-09-07 18:50 ` Steven Deller
2002-09-02 21:35 ` Florian Weimer
2002-09-03 9:11 ` Karl Ran
2002-09-03 2:27 ` David C. Hoos, Sr.
2002-09-03 9:38 ` Karl Ran
2002-09-03 12:15 ` David C. Hoos, Sr.
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox