gkiko
gkiko

Reputation: 2289

Unhandled exception in Visual Studio 2008

I finished writing the program in C++. I used 'cout' for debugging. Everything was working, I deleted the debug comments, but there is a problem with running the program. When I use comments, everything works well. But when I delete them, the program starts, allows me to write file name, but when I press 'enter', the error occures:

Unhandled exception at 0x0142d866 in Pathfinder.exe: 0xC0000005: Access violation reading location 0xcccccc70

and xiosbase header file opens, indicating on

fmtflags __CLR_OR_THIS_CALL flags() const
{   // return format flags
    return (_Fmtfl);
}

The error occurs when I try to put elements in Map. This happens only when the debug comment is removed in the different function. Can anyone help?

-this 0xcccccc6c {_Stdstr=??? _Mystate=??? _Except=??? ...} const std::ios_base * const
    std::_Iosb<int> {...}   std::_Iosb<int>
    __vfptr CXX0030: Error: expression cannot be evaluated  
    _Stdstr CXX0030: Error: expression cannot be evaluated  
    _Mystate CXX0030: Error: expression cannot be evaluated 
    _Except CXX0030: Error: expression cannot be evaluated  
    _Fmtfl  CXX0030: Error: expression cannot be evaluated  
    _Prec   CXX0030: Error: expression cannot be evaluated  
    _Wide   CXX0030: Error: expression cannot be evaluated  
    _Arr    CXX0017: Error: symbol "" not found 
    _Calls  CXX0017: Error: symbol "" not found 
    _Ploc   CXX0017: Error: symbol "" not found 
    _Index  0   int
    _Sync   true    bool

Upvotes: 1

Views: 1447

Answers (2)

pepsi
pepsi

Reputation: 6865

This is going to be a real pain to troubleshoot by analyzing code. The others have pointed you out to a good general direction, but if you don't see something obvious like an uninitialized pointer, then it's probably some kind of memory corruption.

Enable full pageheap for your program, and then run in the debugger again. It should crash earlier if not at the point of corruption, which will give you more information to go forward with.

Upvotes: 0

Bo Persson
Bo Persson

Reputation: 92211

The value 0xcccccc70 looks like the program uses an offset from an uninitialized pointer.

In debug mode memory is filled with 0xcccccccc to make this more visible.

Upvotes: 2

Related Questions