This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Dynamic stack allocation bug, or am I doing something wrong?


"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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]