memory allocation problem
- From: "Seth" <seth_oldham@xxxxxxxxxxx>
- Date: 20 Oct 2005 11:50:14 -0700
I'm having a memory allocation problem that I'm hoping someone can
shed some light on. I'm betting that you'll tell me that I've
done something bad to the heap, and after another 4 or 5 days looking
for the problem I'll probably find that's the case. But I'm
seeing some strange things that I thought might indicate some other
problem.
My application fails intermittently when its release build is launched
outside of visual studio (I'm using Visual C++ .NET 2003 on Windows
XP). I haven't been able to reproduce the problem launching it from
Visual Studio, or launching the debug build outside of Visual Studio.
I have tracked the problem down to the creation of a new object. The
relevant part of the call stack at the time of failure seems to be:
msvcr71.dll!_heap_alloc(unsigned int size=11927992)
msvcr71.dll!_nh_malloc(unsigned int size=11927552, int nhFlag=0)
> msvcr71.dll!_heap_alloc(unsigned int size=28)
msvcr71.dll!_nh_malloc(unsigned int size=28, int nhFlag=0)
msvcr71.dll!malloc(unsigned int size=28)
MFC71.dll!operator new(unsigned int nSize=28)
USCT_FrameExtractor.exe!CIPImage::MakeLabel(int minCompSize=200, bool
filterSideJunk=true)
It looks to me like the size of the block that's getting allocated
gets messed up after the call to HeapAlloc in _heap_alloc_base. I
noticed that the value of _crtheap in the call to HeapAlloc is exactly
the value of the messed up size parameter in the _nh_malloc call. So
somehow it seems like the value of _crtheap param in the call to
HeapAlloc is getting morphed into the size param for future calls. Is
that the kind of thing that I would expect to happen if I've somehow
messed up the heap?
Thanks in advance for any help.
Seth
.
- Follow-Ups:
- Re: memory allocation problem
- From: Oleg Starodumov
- Re: memory allocation problem
- Prev by Date: Re: Close but no cigar
- Next by Date: RE: Disabling exception trace messages
- Previous by thread: Re: Close but no cigar
- Next by thread: Re: memory allocation problem
- Index(es):
Loading