This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Dynamic stack allocation bug, or am I doing something wrong?
- To: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Subject: Re: Dynamic stack allocation bug, or am I doing something wrong?
- From: Iggy Veresov <iggy at homepage dot ru>
- Date: Wed, 12 Apr 2000 22:51:30 +0000
- CC: gcc-bugs at gcc dot gnu dot org
- Organization: Chaos Hack Labz.
- References: <38F4BFAD.6D2383FF@homepage.ru> <200004122138.XAA02787@loewis.home.cs.tu-berlin.de>
"Martin v. Loewis" wrote:
>
> > The following program quits on segmentation fault:
> >
> > #include <stdio.h>
> >
> > int
> > main (void)
> > {
> > char x[1024*1024*10];
> > printf ("Hello..");
> > }
> >
> > Can be compiled with gcc-2.95.2, or with a current snapshot.
> > Optimization options don't matter.
> > linux-2.2.14, glibc-2.1.2. Compilers were configured with
> > --enable-threads.
>
> Thanks for your bug report. I believe this is not a compiler bug, but
> result of your stack limit. What is the output of "limit" on your
> system?
# ulimit -a
core file size (blocks) unlimited
data seg size (kbytes) unlimited
file size (blocks) unlimited
max memory size (kbytes) unlimited
stack size (kbytes) unlimited
cpu time (seconds) unlimited
max user processes 256
pipe size (512 bytes) 8
open files 1024
virtual memory (kbytes) 4194302
Btw, such effect occurs if the size of the array is bigger than 2M.
It looks like some kind of limitation but I just can't pin point where
it is..
>
> Regards,
> Martin
--
/ig,
mailto:iggy@homepage.ru,
http://www.homepage.ru/~iggy