Re: Can I Increase size of nNoMansLandSize?

Tech-Archive recommends: Fix windows errors by optimizing your registry



Does this only happen in Release mode?

AliR.


"Chris Shearer Cooper" <chris_web@xxxxxxx> wrote in message
news:13oqkn42often9a@xxxxxxxxxxxxxxxxxxxxx
My application, for some reason, is writing a single DWORD into a random
location in its memory (the value is always 0x00000001), and I'm trying to
find out where!

I can't find any rhyme or reason to when this happens, so right now the
best I can do is stick a bunch of calls to _CrtCheckMemory() all over the
program and hope that the corruption will (1) hit a memory block in a way
that _CrtCheckMemory() can see it, and (2) that I will eventually be able
to narrow down _when_ this is happening.

But I had a thought. If I could tap into the MFC debug allocation scheme,
and increase the size of nNoMansLandSize, then the chance of the bug
hitting an area of memory that I could detect would increase greatly!

But there doesn't seem to be any way to do this, outside of rebuilding the
MFC libraries, which I guess is a possibility, but not one I'm looking
forward to.

I can't find any other way to tap into the new/debug scheme. I tried
overriding new and delete, but got a bunch of "symbol already defined"
errors. I was thinking if I could tap into that, I could just increase
the size of every allocation (so if the caller wanted 4 bytes, I'd
actually allocate 40 and fill the extra 36 in with something I could check
later).

Any suggestions as to the least painful way to track down this problem?

Thanks!
Chris




.



Relevant Pages

  • Re: Can I Increase size of nNoMansLandSize?
    ... program and hope that the corruption will hit a memory block in a way ... If I could tap into the MFC debug allocation ... I can't find any other way to tap into the new/debug scheme. ...
    (microsoft.public.vc.mfc)
  • Re: Can I Increase size of nNoMansLandSize?
    ... location in its memory, ... If I could tap into the MFC debug allocation ... I can't find any other way to tap into the new/debug scheme. ...
    (microsoft.public.vc.mfc)
  • Re: Can I Increase size of nNoMansLandSize?
    ... look at memory, I see that in the "no man's land" that the debug memory ... allocation creates, one of the DWORDs has been changed to 0x0000001. ... I can't find any rhyme or reason to when this happens, ... I can't find any other way to tap into the new/debug scheme. ...
    (microsoft.public.vc.mfc)
  • Re: Can I Increase size of nNoMansLandSize?
    ... Download the App Verifier and turn on every known memory check. ... If I could tap into the MFC debug allocation scheme, ... I can't find any other way to tap into the new/debug scheme. ...
    (microsoft.public.vc.mfc)
  • Can I Increase size of nNoMansLandSize?
    ... location in its memory, ... I can't find any rhyme or reason to when this happens, ... If I could tap into the MFC debug allocation scheme, ... I can't find any other way to tap into the new/debug scheme. ...
    (microsoft.public.vc.mfc)