Re: A simple program with a large array segfaults

2007-01-04 Thread Mike Stump
On Jan 4, 2007, at 8:49 AM, Gowri Kumar CH wrote: Is this one of the things which we come to know by experience? Yes. Is there a way to find it out from the core/code generated? No. You'd have to have someone tell you, or read up on a UNIX internals book or find a good C book. I'm wond

Re: A simple program with a large array segfaults

2007-01-04 Thread Gowri Kumar CH
Hi andrew, You just overflowed your stack. Increase the stack size for the program by using limit/ulimit or use dynamic allocated memory. Thanks for the quick reply. By changing the size of the stack the error goes away. Is this one of the things which we come to know by experience? Or Is ther

Re: A simple program with a large array segfaults

2007-01-04 Thread J.C.
See the disassembly of the unoptimized & optimized executables produced by GCC!!! :) run.out (inside of the attachment): #!/bin/sh cat $0 echo "" gcc --version # # Unoptimized # gcc -Wall -S arr.c # to see arr.s m

Re: A simple program with a large array segfaults

2007-01-04 Thread Andrew Pinski
> > Greetings, > I'm running gcc on the latest Ubuntu(Edgy) and I get segfault with the > following program: > > > You just overflowed your stack. Increase the stack size for the program by using limit/ulimit or use dynamic allocated memory. This question is more appropriate for gcc-help@ r