From: Andy Maddison Newsgroups: comp.os.msdos.djgpp Subject: I'm going slightly mad!! Date: Tue, 24 Feb 1998 10:45:45 +0000 Organization: Coventry University Lines: 63 Message-ID: NNTP-Posting-Host: leofric.coventry.ac.uk Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk I've been using DJGPP for a while now, just basic C++ 3d graphics programming, and everything has been going quite well. But now I've run into some strange problems: When I execute my current piece of work I sometimes get a General Protection Fault or Floating Point Error, but not everytime! So why does an unchanged program crash periodically? Stranger still: I've had the above errors occur when I've simply invoked gcc to compile my program (for the first time), i.e. gcc crashed without compiling, but on subsequent attempts all went well with compilation and linking (gxx). But then my program crashed again. I've used gdb which imforms me where the error occurs but I've checked the code and there shouldn't be a problem, I've called the same function many times before with the same argument types and all went as expected. I've also had an older program crash (with similar errors) when I executed it during the same session, but it has always worked with no problems. The current program reads some tri-mesh data from a text file, i.e. vertex and face information, and creates new instances of vertices (200+) and polygons (400+). The number of vertices and faces is read at the beginning of the file. So the code looks something like this: read number of vertices and faces from file Vertex** v = new Vertex*[vertices]; Polygon** p = new Polygon*[faces]; for(int i=0;i