Application Error - Caused by STL?
The past few days, I''ve been having a really tough time with this program. It compiles and runs fine in debug mode, and it also compiles fine in release mode, HOWEVER, when I run it in release mode, I get an appliation error. It reads something like this:
The instruction at "0x77fcb03d" referenced memory at "0x00000015". The memory could not be "written".
Since it only happens in release mode, I am unsure how to go about debugging this. It seems to give this error any time an STL object (string or vector) is acccessed. For example, if I enter the code:
vector testVec;
testVec.push_back(1);
or:
string test_str = "testing";
right at the beginning of my main function, it will crash there. I would post more code, but the project is rather large -- it just seems to run fine until the first instance of either vector or string is used (the 2 STL components I use) and then it crashes immediately. If you have any ideas or help or anything, I would truly appreciate it. Thanks. Oh, I''m using MS Visual C++ 6.0 with service pack 5 if that helps.
-lost hope
That''s a null-pointer error - it''s likely a structure, and the data element at a 15byte offset is being referenced.
I haven''t done this with MSVC yet, but you can get the address that the exception occured at, and the base address of the program, then you can calculate the offset into the program that the offending code lives. Then you can have MSVC dump a map of your program (from a release build) and look-up the offset in that map. That should tell you which function and about what line it occured on.
You can also make a third build config, and twiddle compilation options, and see if you can reproduce the error with some debug info present.
I haven''t done this with MSVC yet, but you can get the address that the exception occured at, and the base address of the program, then you can calculate the offset into the program that the offending code lives. Then you can have MSVC dump a map of your program (from a release build) and look-up the offset in that map. That should tell you which function and about what line it occured on.
You can also make a third build config, and twiddle compilation options, and see if you can reproduce the error with some debug info present.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement