From: Cory Bloyd Newsgroups: comp.os.msdos.djgpp Subject: "typePointer = new type[n] ;" SIGSEG's in malloc? Date: Wed, 11 Jun 1997 19:19:14 -0500 Organization: Dept of Computer Sciences, Purdue University Lines: 15 Message-ID: <339F4082.4F93@cs.purdue.edu> Reply-To: bloydcg AT cs DOT purdue DOT edu NNTP-Posting-Host: 225ohiotnt1-206.megsinet.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk I'm writing a program to parse a binary file involving alot of dynamic allocation (but no deallocation required `til the end). All access to the allocated arrays are carefully bounds checked. About midway through the file "new" bombs on me. It always dies in the same place, which is the ninth time the calling function is run. n == 1; Also, the same code with the same input file work just fine in msvc4.2 (I want to keep this in gcc, but I was hoping msvc's debugger could help me ); I'm really more of a C type of guy, not very familiar with this "new" and "delete" stuff from the Object Oriented WonderLand. And so I was wondering if anyone has a suggestion as to what might be causing this? What sort of behavior should one avoid in C++ to prevent such nasty behavior? Thanks, Cory