Why does this code crash Visual Studio 2015?
Clash Royale CLAN TAG#URR8PPP
up vote
46
down vote
favorite
For some reason, even so much as typing this into a C# file in Visual Studio is enough to cause it to instantly crash. Why?
unsafe struct node
node* child;
It seems to occur when the IDE would start coloring keywords and the like.
Trying it in TIO spits out csc.exe exited with code 1
which isn't very helpful.
While array declarations in C# are different than in C/C++, the above seems like it should be perfectly valid. Why isn't it, and why does it crash Visual Studio?
My Visual Studio version is 14.0.23107.
c# visual-studio visual-studio-2015 roslyn
 |Â
show 7 more comments
up vote
46
down vote
favorite
For some reason, even so much as typing this into a C# file in Visual Studio is enough to cause it to instantly crash. Why?
unsafe struct node
node* child;
It seems to occur when the IDE would start coloring keywords and the like.
Trying it in TIO spits out csc.exe exited with code 1
which isn't very helpful.
While array declarations in C# are different than in C/C++, the above seems like it should be perfectly valid. Why isn't it, and why does it crash Visual Studio?
My Visual Studio version is 14.0.23107.
c# visual-studio visual-studio-2015 roslyn
Confirmed, I pasted that code into VS2015 and it immediately froze, then crashed 20 seconds later. If you remove the, it can be safely copied into a VS code window. However, the moment you type the
, VS crashes.
â Amy
Aug 7 at 17:51
VS 2012 produces a compile error:Cannot take the address of, get the size of, or declare a pointer to a managed type
â LarsTech
Aug 7 at 17:54
2
VS2017 instantly, immediately closes
â Camilo Terevinto
Aug 7 at 17:55
2
Ditto LINQPad. StackoverflowException.
â Crowcoder
Aug 7 at 18:00
8
I found an existing bug: github.com/dotnet/roslyn/issues/24978
â Amy
Aug 7 at 18:22
 |Â
show 7 more comments
up vote
46
down vote
favorite
up vote
46
down vote
favorite
For some reason, even so much as typing this into a C# file in Visual Studio is enough to cause it to instantly crash. Why?
unsafe struct node
node* child;
It seems to occur when the IDE would start coloring keywords and the like.
Trying it in TIO spits out csc.exe exited with code 1
which isn't very helpful.
While array declarations in C# are different than in C/C++, the above seems like it should be perfectly valid. Why isn't it, and why does it crash Visual Studio?
My Visual Studio version is 14.0.23107.
c# visual-studio visual-studio-2015 roslyn
For some reason, even so much as typing this into a C# file in Visual Studio is enough to cause it to instantly crash. Why?
unsafe struct node
node* child;
It seems to occur when the IDE would start coloring keywords and the like.
Trying it in TIO spits out csc.exe exited with code 1
which isn't very helpful.
While array declarations in C# are different than in C/C++, the above seems like it should be perfectly valid. Why isn't it, and why does it crash Visual Studio?
My Visual Studio version is 14.0.23107.
c# visual-studio visual-studio-2015 roslyn
edited Aug 7 at 17:57
Amy
20.3k1771131
20.3k1771131
asked Aug 7 at 17:48
Orion
43537
43537
Confirmed, I pasted that code into VS2015 and it immediately froze, then crashed 20 seconds later. If you remove the, it can be safely copied into a VS code window. However, the moment you type the
, VS crashes.
â Amy
Aug 7 at 17:51
VS 2012 produces a compile error:Cannot take the address of, get the size of, or declare a pointer to a managed type
â LarsTech
Aug 7 at 17:54
2
VS2017 instantly, immediately closes
â Camilo Terevinto
Aug 7 at 17:55
2
Ditto LINQPad. StackoverflowException.
â Crowcoder
Aug 7 at 18:00
8
I found an existing bug: github.com/dotnet/roslyn/issues/24978
â Amy
Aug 7 at 18:22
 |Â
show 7 more comments
Confirmed, I pasted that code into VS2015 and it immediately froze, then crashed 20 seconds later. If you remove the, it can be safely copied into a VS code window. However, the moment you type the
, VS crashes.
â Amy
Aug 7 at 17:51
VS 2012 produces a compile error:Cannot take the address of, get the size of, or declare a pointer to a managed type
â LarsTech
Aug 7 at 17:54
2
VS2017 instantly, immediately closes
â Camilo Terevinto
Aug 7 at 17:55
2
Ditto LINQPad. StackoverflowException.
â Crowcoder
Aug 7 at 18:00
8
I found an existing bug: github.com/dotnet/roslyn/issues/24978
â Amy
Aug 7 at 18:22
Confirmed, I pasted that code into VS2015 and it immediately froze, then crashed 20 seconds later. If you remove the
, it can be safely copied into a VS code window. However, the moment you type the
, VS crashes.â Amy
Aug 7 at 17:51
Confirmed, I pasted that code into VS2015 and it immediately froze, then crashed 20 seconds later. If you remove the
, it can be safely copied into a VS code window. However, the moment you type the
, VS crashes.â Amy
Aug 7 at 17:51
VS 2012 produces a compile error:
Cannot take the address of, get the size of, or declare a pointer to a managed type
â LarsTech
Aug 7 at 17:54
VS 2012 produces a compile error:
Cannot take the address of, get the size of, or declare a pointer to a managed type
â LarsTech
Aug 7 at 17:54
2
2
VS2017 instantly, immediately closes
â Camilo Terevinto
Aug 7 at 17:55
VS2017 instantly, immediately closes
â Camilo Terevinto
Aug 7 at 17:55
2
2
Ditto LINQPad. StackoverflowException.
â Crowcoder
Aug 7 at 18:00
Ditto LINQPad. StackoverflowException.
â Crowcoder
Aug 7 at 18:00
8
8
I found an existing bug: github.com/dotnet/roslyn/issues/24978
â Amy
Aug 7 at 18:22
I found an existing bug: github.com/dotnet/roslyn/issues/24978
â Amy
Aug 7 at 18:22
 |Â
show 7 more comments
1 Answer
1
active
oldest
votes
up vote
39
down vote
accepted
This is a known bug in Roslyn. This bug will affect any version of Visual Studio that uses Roslyn.
If I am interpreting VersionOf.net correctly, the first version of Visual Studio with Roslyn built-in is 2015. Before then, I think it was available only as an extension. So, Visual Studio 2013 and prior should be unaffected.
It's due to be fixed in the milestone 16 release. At this time, that release is not scheduled.
Because this is a bug in Roslyn, you can "get around" it by editing and compiling the code containing the unsafe struct
in an older version of Visual Studio, one that predates Roslyn. Visual Studio 2012 should work. You can then use the resultant .DLL in your current software.
An unverified fix is available if you build Roslyn yourself from this branch. The fix was made in this commit.
3
according to this, you're qualifying for step number 3 or 4: meta.stackexchange.com/a/132704/382678 between awesome and legendary.
â Jean-François Fabre
Aug 7 at 19:49
nice move answering this properly: the question is probably in the 10k tools best questions of today. So here comes the 20k ;)
â Jean-François Fabre
Aug 7 at 19:50
@Jean-FrançoisFabre What is "10k tools best questions of today"?
â Amy
Aug 7 at 21:05
stackoverflow.com/tools. This question is indeed #1. seems that I was right :)
â Jean-François Fabre
Aug 7 at 21:06
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
39
down vote
accepted
This is a known bug in Roslyn. This bug will affect any version of Visual Studio that uses Roslyn.
If I am interpreting VersionOf.net correctly, the first version of Visual Studio with Roslyn built-in is 2015. Before then, I think it was available only as an extension. So, Visual Studio 2013 and prior should be unaffected.
It's due to be fixed in the milestone 16 release. At this time, that release is not scheduled.
Because this is a bug in Roslyn, you can "get around" it by editing and compiling the code containing the unsafe struct
in an older version of Visual Studio, one that predates Roslyn. Visual Studio 2012 should work. You can then use the resultant .DLL in your current software.
An unverified fix is available if you build Roslyn yourself from this branch. The fix was made in this commit.
3
according to this, you're qualifying for step number 3 or 4: meta.stackexchange.com/a/132704/382678 between awesome and legendary.
â Jean-François Fabre
Aug 7 at 19:49
nice move answering this properly: the question is probably in the 10k tools best questions of today. So here comes the 20k ;)
â Jean-François Fabre
Aug 7 at 19:50
@Jean-FrançoisFabre What is "10k tools best questions of today"?
â Amy
Aug 7 at 21:05
stackoverflow.com/tools. This question is indeed #1. seems that I was right :)
â Jean-François Fabre
Aug 7 at 21:06
add a comment |Â
up vote
39
down vote
accepted
This is a known bug in Roslyn. This bug will affect any version of Visual Studio that uses Roslyn.
If I am interpreting VersionOf.net correctly, the first version of Visual Studio with Roslyn built-in is 2015. Before then, I think it was available only as an extension. So, Visual Studio 2013 and prior should be unaffected.
It's due to be fixed in the milestone 16 release. At this time, that release is not scheduled.
Because this is a bug in Roslyn, you can "get around" it by editing and compiling the code containing the unsafe struct
in an older version of Visual Studio, one that predates Roslyn. Visual Studio 2012 should work. You can then use the resultant .DLL in your current software.
An unverified fix is available if you build Roslyn yourself from this branch. The fix was made in this commit.
3
according to this, you're qualifying for step number 3 or 4: meta.stackexchange.com/a/132704/382678 between awesome and legendary.
â Jean-François Fabre
Aug 7 at 19:49
nice move answering this properly: the question is probably in the 10k tools best questions of today. So here comes the 20k ;)
â Jean-François Fabre
Aug 7 at 19:50
@Jean-FrançoisFabre What is "10k tools best questions of today"?
â Amy
Aug 7 at 21:05
stackoverflow.com/tools. This question is indeed #1. seems that I was right :)
â Jean-François Fabre
Aug 7 at 21:06
add a comment |Â
up vote
39
down vote
accepted
up vote
39
down vote
accepted
This is a known bug in Roslyn. This bug will affect any version of Visual Studio that uses Roslyn.
If I am interpreting VersionOf.net correctly, the first version of Visual Studio with Roslyn built-in is 2015. Before then, I think it was available only as an extension. So, Visual Studio 2013 and prior should be unaffected.
It's due to be fixed in the milestone 16 release. At this time, that release is not scheduled.
Because this is a bug in Roslyn, you can "get around" it by editing and compiling the code containing the unsafe struct
in an older version of Visual Studio, one that predates Roslyn. Visual Studio 2012 should work. You can then use the resultant .DLL in your current software.
An unverified fix is available if you build Roslyn yourself from this branch. The fix was made in this commit.
This is a known bug in Roslyn. This bug will affect any version of Visual Studio that uses Roslyn.
If I am interpreting VersionOf.net correctly, the first version of Visual Studio with Roslyn built-in is 2015. Before then, I think it was available only as an extension. So, Visual Studio 2013 and prior should be unaffected.
It's due to be fixed in the milestone 16 release. At this time, that release is not scheduled.
Because this is a bug in Roslyn, you can "get around" it by editing and compiling the code containing the unsafe struct
in an older version of Visual Studio, one that predates Roslyn. Visual Studio 2012 should work. You can then use the resultant .DLL in your current software.
An unverified fix is available if you build Roslyn yourself from this branch. The fix was made in this commit.
edited Aug 7 at 20:08
answered Aug 7 at 19:48
Amy
20.3k1771131
20.3k1771131
3
according to this, you're qualifying for step number 3 or 4: meta.stackexchange.com/a/132704/382678 between awesome and legendary.
â Jean-François Fabre
Aug 7 at 19:49
nice move answering this properly: the question is probably in the 10k tools best questions of today. So here comes the 20k ;)
â Jean-François Fabre
Aug 7 at 19:50
@Jean-FrançoisFabre What is "10k tools best questions of today"?
â Amy
Aug 7 at 21:05
stackoverflow.com/tools. This question is indeed #1. seems that I was right :)
â Jean-François Fabre
Aug 7 at 21:06
add a comment |Â
3
according to this, you're qualifying for step number 3 or 4: meta.stackexchange.com/a/132704/382678 between awesome and legendary.
â Jean-François Fabre
Aug 7 at 19:49
nice move answering this properly: the question is probably in the 10k tools best questions of today. So here comes the 20k ;)
â Jean-François Fabre
Aug 7 at 19:50
@Jean-FrançoisFabre What is "10k tools best questions of today"?
â Amy
Aug 7 at 21:05
stackoverflow.com/tools. This question is indeed #1. seems that I was right :)
â Jean-François Fabre
Aug 7 at 21:06
3
3
according to this, you're qualifying for step number 3 or 4: meta.stackexchange.com/a/132704/382678 between awesome and legendary.
â Jean-François Fabre
Aug 7 at 19:49
according to this, you're qualifying for step number 3 or 4: meta.stackexchange.com/a/132704/382678 between awesome and legendary.
â Jean-François Fabre
Aug 7 at 19:49
nice move answering this properly: the question is probably in the 10k tools best questions of today. So here comes the 20k ;)
â Jean-François Fabre
Aug 7 at 19:50
nice move answering this properly: the question is probably in the 10k tools best questions of today. So here comes the 20k ;)
â Jean-François Fabre
Aug 7 at 19:50
@Jean-FrançoisFabre What is "10k tools best questions of today"?
â Amy
Aug 7 at 21:05
@Jean-FrançoisFabre What is "10k tools best questions of today"?
â Amy
Aug 7 at 21:05
stackoverflow.com/tools. This question is indeed #1. seems that I was right :)
â Jean-François Fabre
Aug 7 at 21:06
stackoverflow.com/tools. This question is indeed #1. seems that I was right :)
â Jean-François Fabre
Aug 7 at 21:06
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f51732647%2fwhy-does-this-code-crash-visual-studio-2015%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Confirmed, I pasted that code into VS2015 and it immediately froze, then crashed 20 seconds later. If you remove the
, it can be safely copied into a VS code window. However, the moment you type the
, VS crashes.
â Amy
Aug 7 at 17:51
VS 2012 produces a compile error:
Cannot take the address of, get the size of, or declare a pointer to a managed type
â LarsTech
Aug 7 at 17:54
2
VS2017 instantly, immediately closes
â Camilo Terevinto
Aug 7 at 17:55
2
Ditto LINQPad. StackoverflowException.
â Crowcoder
Aug 7 at 18:00
8
I found an existing bug: github.com/dotnet/roslyn/issues/24978
â Amy
Aug 7 at 18:22