Search

C/C++ Optimizing Compiler has stopped working - System.Core and String^ related by Yi Feng Li

Closed
as Fixed Help for as Fixed

3
0
Sign in
to vote
Type: Bug
ID: 629262
Opened: 12/6/2010 8:45:50 PM
Access Restriction: Public
0
Workaround(s)
2
User(s) can reproduce this bug
When we add a reference to System.Core, we find an issue which related to managed class String^. If we turn off the Precompiled Headers, any use of String::Format() always causes the crash. Also in another class that did some string marshalling it causes a crash in the msclr\marshal.h file on line 49.

This problem can be reproduced using VS2008, VS2010 (Toolsets V90) with .Net Framework 3.5.
Details (expand)

Visual Studio/Silverlight/Tooling version

Visual Studio 2010

What category (if any) best represents this feedback?

Performance

Steps to reproduce

1.Create a new System Console CLR project in C++
2.Add a reference to System.Core
3.Set Create/Use Precompiled Header to "Not Using Precompiled Headers" -IMPORTANT
4.Add the following code and hit CTRL-F7 - The compiler crashes.
5.Comment out the Line that starts with String^
6.Hit CTRL-F7 the code compiles.


#include "stdafx.h"

using namespace System;
using namespace System::IO;
using namespace System::IO::Pipes;



int main(array<System::String ^> ^args)
{
    NamedPipeServerStream^ pipe_stream = gcnew NamedPipeServerStream("test",PipeDirection::InOut);
    String^ msg = String::Format("This will cause the compiler to crash {0} when System.Core is referenced",1);
Console::WriteLine(L"Hello World");
return 0;
}

Product Language

English

Operating System

Windows 7

Operating System Language

English

Actual results

Generates a C1001: An internal error has occurred in the compiler and get a dialog that states "Microsoft (R) C/C++ Optimizing Compiler has stopped working ... and a Close program button.

Expected results

Compiled sucessfully
File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 1/4/2011 at 3:30 PM
Hello Yi Feng Li,

Thank you for your report. This bug is fixed on the patch KB976656.

Thanks,
Ulzii Luvsanbat
Windows C++ Team
Posted by Microsoft on 12/7/2010 at 5:37 PM
Thanks for your feedback.

We are rerouting 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 12/7/2010 at 11:21 AM
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)
Posted by Sheng Jiang 蒋晟 on 12/7/2010 at 9:17 AM
duplicate of https://connect.microsoft.com/VisualStudio/feedback/details/629060/compiler-crash-related-to-system-core-and-string
Sign in to post a workaround.