Date: Wed, 10 Nov 1999 13:58:44 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Sebastian Buntin cc: djgpp AT delorie DOT com Subject: Re: problem with large arrays -> SIGSEGV Stack Fault In-Reply-To: <001a01bf2a1b$508f10a0$641e13ac@garfield.gobi-gotha.de> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Mon, 8 Nov 1999, Sebastian Buntin wrote: > typedef struct { > > float x,y,z; > float w; > int faces; > int faceto[10]; > } vector3d; > > int main () { > // some declarations.... > int k; > vector3d obj[8000]; > printf("HELLO\n"); > > for (k=0;k<8000;k++) > do_some_stuff(&obj[k], var1, var2); > > > // rest of code (switch to graphic mode, putpixel, etc...) > } > > using this code works very well (and of course FAST)...but if I increase the > array-size, or add MANY more variables, the program still compiles very > well...but breaks with > > SIGSEGV > Stack Fault at eip=00001b21 You are overflowing the 512KB run-time stack ("8000*sizeof(vector3d)" is _way_ more than 512KB). See section 15.9 of the DJGPP FAQ list for more about this.