comp.lang.ada
 help / color / mirror / Atom feed
From: Mark Johnson <Mark_H_Johnson@Raytheon.com>
Subject: Re: reasons for segmentation faults on linux
Date: Wed, 28 Nov 2001 12:04:40 -0600
Date: 2001-11-28T12:04:40-06:00	[thread overview]
Message-ID: <3C052738.AEF0049E@Raytheon.com> (raw)
In-Reply-To: slrna0a2ch.3dp.randhol+abuse@kiuk0156.chembio.ntnu.no

Preben Randhol wrote:

> [snip]

> Infinite recursion:
>
> procedure A is
> begin
>    A;
> end A;
>
> % gnatmake a.adb
> gnatgcc -c a.adb
> a.adb:3:04: warning: possible infinite aursion
> a.adb:3:04: warning: Storage_Error may be raised at run time
> gnatbind -x a.ali
> gnatlink a.ali
>
> % ./a
> Segmentation fault
>
> Why isn't Storage_Error raised? GNAT 3.13p on GNU/Debian Linux.
>

RTFM :-). Add -fstack-check to the gnatmake command line to get stack
checking turned on.

As a suggestion, define an environment name w/ the "desired" command line
options & use it instead. At our site...
  GNAT_TESTING="-g -gnata -funwind-tables -gnatO -j3 -gnatn -O2 -gnatwa
-gnatf -fstack-check -gnato -gnatq -gnatU"
and it properly issues the error...

raised STORAGE_ERROR : stack overflow detected

Though perhaps I should submit a bug report to ACT about the warning being in
error if stack checking is suppressed.
  --Mark





  reply	other threads:[~2001-11-28 18:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-28 12:03 reasons for segmentation faults on linux Tony
2001-11-28 12:49 ` Marc A. Criley
2001-11-28 15:59   ` Preben Randhol
2001-11-28 18:04     ` Mark Johnson [this message]
2001-11-28 22:31     ` David Starner
2001-11-29  3:39       ` Robert Dewar
2001-11-29 18:42         ` David Starner
2001-11-29  3:36     ` Robert Dewar
2001-11-29 10:36       ` Preben Randhol
2001-11-29 11:01         ` Preben Randhol
replies disabled

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