iterator assignment operator crashes in debug builds due to stl changes in vc10 - by Thành aka ttp

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.


2
0
Sign in
to vote
ID 577672 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 7/23/2010 4:47:24 AM
Access Restriction Public

Description

A similar bug #458027 was closed as by design in 6/2009. I'd like another look from the development team as I feel this is a bug in the vc10 xutility code.

An iterator is similar to a pointer. It can hold a singlular value initially, and it makes sense to allow it to be reset with a singular value. An analogy using pointers: this "const char* s=0; s="abc"; s=0;" code is valid and crashes are expected if you dereference a null pointer. Similar iterator code like "std::string::const_iterator it0, it1; it1=s.begin(); it1=it0;" should be considered valid and crashes are expected if you dereference an iterator holding a singular value.

Real code in microsoft's greta-2.6.4 which should be considered valid:
IterT & reserved1 = param.m_prgbackrefs[ m_cgroup ].reserved1;
IterT old_ibegin = reserved1;
reserved1 = icur;
:
reserved1 = old_ibegin; //can unexpectedly crash in vc10 debug builds
Sign in to post a comment.
Posted by Microsoft on 10/31/2010 at 10:14 PM
Hi,

Thanks for reporting this bug. We've fixed it, and the fix will be available in VC11. C++98/03 didn't require singular iterators to be acceptable assignment sources, but C++0x does, and we should now conform to C++0x.

If you have any further questions, feel free to E-mail me at stl@microsoft.com .

Stephan T. Lavavej
Visual C++ Libraries Developer
Posted by Microsoft on 7/25/2010 at 7:22 PM
Thanks for your feedback. We are routing this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by Microsoft on 7/24/2010 at 7:06 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)