I am having problems running vs2008 SP1 in debug mode when I try to disable checked iterators. The following program reproduces the problem (failure in the line descriptor):
#define _HAS_ITERATOR_DEBUGGING 0 #include <sstream> int do_stuff(std::string const& text) { std::string::const_iterator i(text.end()); return 0; } int main() { std::ostringstream os; os << "some_text"; return do_stuff(os.str()); }
I found a similar post on gamdev.net that discussed this issue in vs2005. The sample program in this post compiles for me in 2008 Service Pack 1 (SP1) as it is, but when I modified it to use ostringstream, I was able to get the problem.
From pushing in the debugger, it looks like the library is pushing iterators out of the stack and then trying to use them in _Orphan_All, which is some kind of iterator check cleaning code ...
Can anyone else reproduce this problem or tell me what is going on?
Thanks!
c ++ iterator debugging visual-studio-2008 crash
Nathan monteleone
source share