Hi,
This is regarding a problem encountered on executing code developed using VS2005 using C++ Standard Libraries.
I have a member in a class of type std::map. The class definition is indicated below (There are some other class members which I am not indicating here so as to not occupy space)
When the above class is used in the execution of a program and the Rational Purifier tool is being used to analyze memory issues, the following error was indicated in the line marked above :Code:class DataHolder { private : map<DWORD, MyClass *> m_MyMap; public : DataHolder() { m_MyMap.clear(); } void MyMethod() { DWORD j = GetValue(); map<DWORD,MyClass*>::iterator it = m_MyMap.begin(); it = m_MyMap.find(j); //Rational Purifier indicated a problem in this line if (it == m_MyMap.end()) { printf("Data has not been found in the map"); } } . . . . . . }
"Uninitialized Memory Read "
The next level of instructions displayed by the Rational Purifier editor shows the following
The problem is indicated in the line shown by "=> " in the snippet above.Code:std::_Tree<class std::_Tmap_traits<unsigned long,class MyClass *,struct std::less<unsigned long>,class std::allocator<struct std::pair<unsigned long const ,class MyClass *> >,0> >::_Lbound(unsigned long const &)const [c:\program files\microsoft visual studio 8\vc\include\xtree.:1174] _Nodeptr _Wherenode = _Myhead; // end() if search fails while (!_Isnil(_Pnode)) => if (_DEBUG_LT_PRED(this->comp, _Key(_Pnode), _Keyval)) _Pnode = _Right(_Pnode); // descend right subtree else { // _Pnode not less than _Keyval, remember it
Can someone please provide some clues on why this is being indicated and what would be the possible solution.




Reply With Quote