Archived

This topic is now archived and is closed to further replies.

Application Error - Caused by STL?

This topic is 5774 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Hey, thanks for responding! Unfortunately, I am unsure how to go about doing what you mentioned. For example, how would I figure out the base address of my program, and how would I go about dumping it into a map? If anybody knows, could they please let me know. Thanks.

Share this post


Link to post
Share on other sites