Visual C++: Global Variables Crash Edit-and-Continue - by Timothy003

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.

Sign in
to vote
ID 681524 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 7/28/2011 9:12:33 PM
Access Restriction Public


Edit and Continue crashes when global variables are defined in the following way.
Sign in to post a comment.
Posted by Timothy003 on 8/18/2011 at 11:36 AM
Thanks for fixing this bug. It's very hard to work around in modern C++. VC's own <type_traits> header defines variables this way and confuses the edit and continue engine. I can't wait to test the fix!

Posted by Microsoft on 8/17/2011 at 3:40 PM
It is a problem in our product that the edit and continue engine mistakenly thinks that the .rdata section has changed. We have solved the problme and the fix will be included in our next major product release.

The work around is to reduce the number of const and static class member variables or to initialize them randomly, if possible.

Thanks very much for the bug report!
VC++ CodeGen and Tools
Posted by Microsoft on 8/9/2011 at 11:51 PM
Thank you for submitting feedback on Visual Studio 2010 and .NET Framework. Your issue has been routed to the appropriate VS development team for review. We will contact you if we require any additional information.
Posted by Timothy003 on 8/8/2011 at 11:44 PM
That's correct, as long as you get the exact error (note the ".rdata"). The cast to void is just to avoid a compile warning. I actually just added and deleted a newline at the end of the file to enable me to apply code changes. Visual Studio doesn't exactly crash as in the description with this code; it takes a lot more global variables to crash it.

Posted by Microsoft on 8/8/2011 at 11:26 PM
Hi Timothy003,

Thanks for your feedback. To get a perfect repro, could you please help to confirm the following?

1. The main method before debugging is like
int main()
2. When debugging, change the main method into:
int main()
3. Continue debugging will cause the error described.

Please feel free to let me know if the above meet you situation or not.

Thank you.
Posted by Timothy003 on 8/8/2011 at 6:39 PM
Sorry for the poor steps. I've attached a sample project zip.

Posted by EricLeong [Feedback Moderator] on 8/8/2011 at 2:52 AM
Thank you for reporting this issue.

Sorry for delay. In order to research the issue reported, we must first reproduce in our labs. Unfortunately, we are unable to reproduce the issue with the steps you provided.

Could you please provide us with a sample project zip?

It would be greatly appreciated if you could provide us this information as quickly as possible.

Thank you
Posted by MS-Moderator01 on 7/28/2011 at 9:50 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(