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

A simple program with a large array segfaults

2007-01-04 Thread Gowri Kumar CH
Greetings, I'm running gcc on the latest Ubuntu(Edgy) and I get segfault with the following program: #include #include #define SIZE (INT_MAX>>3) int main() { int arr[SIZE]; printf("%d\n",SIZE); return 0; } bash$ gcc --version gcc (GCC) 4.1.2 20060928 (prerelease) (Ubu