comp.lang.ada
 help / color / mirror / Atom feed
From: jonathan <johnscpg@googlemail.com>
Subject: Re: segfault with large-ish array with GNAT
Date: Wed, 17 Mar 2010 12:57:12 -0700 (PDT)
Date: 2010-03-17T12:57:12-07:00	[thread overview]
Message-ID: <61982ea9-58da-44fa-8d48-4e9024c34992@g11g2000yqe.googlegroups.com> (raw)
In-Reply-To: 642ddf8b-1d45-4f74-83ad-2c755040ca33@k24g2000pro.googlegroups.com

On Mar 17, 7:21 pm, Jerry <lancebo...@qwest.net> wrote:
> The following program produces a segmentation fault when run with the
> array size set to 1_048_343 but not when it is set to 1_048_342.
> What's going on and how do I fix it? If I put in a bit of text IO the
> allowed array size is some what smaller.
>
> GNATMAKE 4.4.0 20080314 (experimental) [trunk revision 133226]
> OS X 10.5.8
> 4 GB RAM
>
> procedure bomb is
>     type Float_Array_Type is array (Integer range <>) of Long_Float;
>     -- 1_048_343 causes segmentation fault, 1_048_342  does not.
>     x : Float_Array_Type(1 .. 1_048_343);
> begin
>     x(1) := 1.0;
> end bomb;
>
> Jerry

Have you tried setting the stacksize in your shell.  In bash the
command is

ulimit -s unlimited

in csh, (I seem to recall):

limit stacksize unlimited

Type ulimit or limit to see what the defaults are.
When I do it on Debian Linux, your program I get arrays up to
2 Gigabyte in size.

HTH ...

Jonathan






      parent reply	other threads:[~2010-03-17 19:57 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-17 19:21 segfault with large-ish array with GNAT Jerry
2010-03-17 19:36 ` Gautier write-only
2010-03-17 19:58   ` Georg Bauhaus
2010-03-18  6:45     ` Jerry
2010-03-18  7:52       ` Ludovic Brenta
2010-03-18 23:57         ` Robert A Duff
2010-03-18 10:13       ` Jeffrey Creem
2010-03-18 10:23         ` Ludovic Brenta
2010-03-19  0:44           ` Jerry
2010-03-18 19:51         ` Adam Beneschan
2010-03-18 14:44       ` John B. Matthews
2010-03-19  4:44         ` Jeffrey R. Carter
2010-03-19  8:14           ` John B. Matthews
2010-03-18 15:36       ` Gautier write-only
2010-03-18 16:46       ` tmoran
2010-03-18 19:11         ` Warren
2010-03-18 17:03       ` Warren
2010-03-18 20:38         ` Maciej Sobczak
2010-03-19 13:26           ` Charmed Snark
2010-03-19 17:27             ` tmoran
2010-03-19 18:02               ` Simon Wright
2010-03-19 20:10                 ` Warren
2010-03-19 21:50                 ` Adam Beneschan
2010-03-19 20:24               ` Warren
2010-03-19 20:38           ` Warren
2010-03-19  8:31         ` Ludovic Brenta
2010-03-19 13:20           ` Warren
2010-03-19 12:04       ` Brian Drummond
2010-03-19 19:22         ` Jerry
2010-03-19 20:22         ` Jeffrey R. Carter
2010-03-19 23:24           ` Jerry
2010-03-20  0:25             ` Jeffrey R. Carter
2010-05-07 21:58       ` Raising the stack limit (was: segfault with large-ish array with GNAT) Björn Persson
2010-03-17 19:57 ` jonathan [this message]
replies disabled

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