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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a59c0afeb6808e51,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-08-31 00:58:24 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: karlran@hotmail.com (Karl Ran) Newsgroups: comp.lang.ada Subject: Howto debug seg-faulting Ada 95 code? Date: 31 Aug 2002 00:58:24 -0700 Organization: http://groups.google.com/ Message-ID: <1f358d66.0208302358.6f1c6a39@posting.google.com> NNTP-Posting-Host: 217.227.78.91 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1030780704 18465 127.0.0.1 (31 Aug 2002 07:58:24 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 31 Aug 2002 07:58:24 GMT Xref: archiver1.google.com comp.lang.ada:28620 Date: 2002-08-31T07:58:24+00:00 List-Id: 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...