This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: gcc - Bug (?) - which isn't
- To: bug-gcc at gnu dot org, m dot flower at trl dot oz dot au
- Subject: Re: gcc - Bug (?) - which isn't
- From: Mike Stump <mrs at windriver dot com>
- Date: Tue, 19 Oct 1999 09:45:13 -0700 (PDT)
> Date: Tue, 19 Oct 1999 17:53:05 +1000
> From: Michael Flower <m.flower@trl.oz.au>
> Organization: Teslstra Research Labs
> main() {
> int a[2096145];
> a[15] = 15;
> }
> It appears that under Solaris, the maximum stack size is 8mb!!!!
You got what you asked for:
bash[452] ulimit -a
core file size (blocks) 0
data seg size (kbytes) 2097148
file size (blocks) unlimited
open files 64
pipe size (512 bytes) 10
stack size (kbytes) 8192
cpu time (seconds) unlimited
max user processes 1973
virtual memory (kbytes) unlimited
notice the 8192 right next to the word stack size. Notice how this
exactly matches what you observed. Maybe, if you tell the OS you want
a different stack size, you might be able to make it work. Welcome to
UNIX.
As you guess, this isn't a bug in either the OS or the compiler... it
is just how it works. This is why most people use malloc for large
things.