Mail Archives: djgpp/1997/06/15/06:19:42
From: | Cory Bloyd <bloydcg AT cs DOT purdue DOT edu>
|
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
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
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
- Raw text -