0

Software environment: Visual Studio 2008 C++ project

I have a code that builds fine. However when I start to debug the code it spits out the following error:

Unhandled exception at 0x7694b9bc in xyz.exe: Microsoft C++ exception: CDBException at memory location 0x06d0f410.

The error seems to occur in the file dbgheap.c at this function:

    void * pvBlk = _nh_malloc_dbg_impl(nSize, nhFlag, nBlockUse, szFileName, nLine, &errno_tmp);

In the watch variables I'm getting the message for szFileName:

    CX0030: Error: expression cannot be evaluated

Can anyone please tell me what is happening as the file in which the error is occurring is in a system file. I have no idea where the code might be going haywire. Where should I start debugging in this scenario.

This is the stack trace:

KernelBase.dll!7694b9bc()   
[Frames below may be incorrect and/or missing, no symbols loaded for KernelBase.dll]    
KernelBase.dll!7694b9bc()   
msvcr90d.dll!_nh_malloc_dbg(unsigned int nSize=36, int nhFlag=0, int nBlockUse=8684696, const char * szFileName=0x00000000, int nLine=44349400)  Line 296 + 0x1d bytes  C++
msvcr90d.dll!_malloc_dbg(unsigned int nSize=0, int nBlockUse=0, const char * szFileName=0x02a4bd08, int nLine=143947928)  Line 160 + 0x1b bytes C++

I'm unable to locate which part of the code is triggering the error as the file is linked over many header and source files.

Thanks a lot in advance for any inputs!!

sriramn
  • 2,338
  • 4
  • 35
  • 45
  • bug exposed by different memory footprint in debug mode? – Mitch Wheat May 06 '12 at 03:53
  • @MitchWheat Can you be a bit more explicit... I'm unable to follow your line of thought.. – sriramn May 06 '12 at 03:55
  • Can you please paste the stack trace at the time of the crash? Also, can you paste the relevant code in *your* function where the crash occurs? If you're running in the Visual Studio debugger, you should be able to do this by running the application in the debugger. – Dan Nissenbaum May 06 '12 at 04:20
  • @DanNissenbaum I have modified the question... As I have mentioned... I still am not able to figure out from where this error is popping up! – sriramn May 06 '12 at 05:10
  • Are you able to run the application from within the Visual Studio environment (i.e., by setting up the required arguments in the project settings, and hitting F5 (or choosing the equivalent menu option))? – Dan Nissenbaum May 06 '12 at 05:35

0 Answers0