This is a real blocker issue for my team. Since update 3, we cannot edit certain files in our solution anymore - visual studio completely freezes when changing code and then after several seconds it crashes.
This is the output of the windows event log:
Faulting application name: devenv.exe, version: 14.0.25420.1, time stamp: 0x57685d85
Faulting module name: Microsoft.CodeAnalysis.CSharp.ni.dll, version: 1.3.1.60616, time stamp: 0xac5e790e
Exception code: 0xc00000fd
Fault offset: 0x002ced15
Faulting process ID: 0x1414
Faulting application start time: 0x01d1d365a3e416c5
Faulting application path: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe
Faulting module path: C:\WINDOWS\assembly\NativeImages_v4.0.30319_32\Microsoft.C1d3c2215#\f217b46a2e086bed6974523572037c2c\Microsoft.CodeAnalysis.CSharp.ni.dll
Report ID: 72eedbbc-cd10-4a81-aa31-5684bf1a1bc8
Faulting package full name:
Faulting package-relative application ID:
Unfortunately I have not been able the create a minimal repro yet (in a new project), It seems to only occur in specific file/project constellations.
Question: Is this issue known? Has somebody been able to provide a minimal repro?
Our current workaround is to edit these files in Notepad++
.. which sucks as you can imagine :/
One of my team-members already tried to downgrade to Update2 which resulted in a disaster ... (TLDR: Complete reinstall of windows was necessary because everything was broken afterwards)
Our team is experiencing the same problem. We have downgraded to update 2.
The crash is a StackOverflowException, with this stacktrace:
> mscorlib.dll!System.Text.StringBuilder.ExpandByABlock(int minBlockCharCount) Unknown
mscorlib.dll!System.Text.StringBuilder.Append(char* value, int valueCount) Unknown
mscorlib.dll!System.Text.StringBuilder.AppendHelper(string value) Unknown
mscorlib.dll!System.Text.StringBuilder.Append(string value) Unknown
Microsoft.CodeAnalysis.Workspaces.dll!Microsoft.CodeAnalysis.SymbolId.Generator.VisitNamedType(Microsoft.CodeAnalysis.INamedTypeSymbol symbol) Unknown
Microsoft.CodeAnalysis.Workspaces.dll!Microsoft.CodeAnalysis.SymbolId.Generator.Visit(Microsoft.CodeAnalysis.ISymbol symbol) Unknown
Microsoft.CodeAnalysis.Workspaces.dll!Microsoft.CodeAnalysis.SymbolId.Generator.VisitNamedType(Microsoft.CodeAnalysis.INamedTypeSymbol symbol) Unknown
Microsoft.CodeAnalysis.Workspaces.dll!Microsoft.CodeAnalysis.SymbolId.Generator.Visit(Microsoft.CodeAnalysis.ISymbol symbol) Unknown
Microsoft.CodeAnalysis.Workspaces.dll!Microsoft.CodeAnalysis.SymbolId.Generator.VisitTypeParameter(Microsoft.CodeAnalysis.ITypeParameterSymbol symbol) Unknown
Microsoft.CodeAnalysis.Workspaces.dll!Microsoft.CodeAnalysis.SymbolId.Generator.Visit(Microsoft.CodeAnalysis.ISymbol symbol) Unknown
Microsoft.CodeAnalysis.Workspaces.dll!Microsoft.CodeAnalysis.SymbolId.Generator.EncodeGenericTypeInfo(Microsoft.CodeAnalysis.INamedTypeSymbol symbol) Unknown
Microsoft.CodeAnalysis.Workspaces.dll!Microsoft.CodeAnalysis.SymbolId.Generator.VisitNamedType(Microsoft.CodeAnalysis.INamedTypeSymbol symbol) Unknown
Microsoft.CodeAnalysis.Workspaces.dll!Microsoft.CodeAnalysis.SymbolId.Generator.Visit(Microsoft.CodeAnalysis.ISymbol symbol) Unknown
Microsoft.CodeAnalysis.Workspaces.dll!Microsoft.CodeAnalysis.SymbolId.Generator.VisitTypeParameter(Microsoft.CodeAnalysis.ITypeParameterSymbol symbol) Unknown
Microsoft.CodeAnalysis.Workspaces.dll!Microsoft.CodeAnalysis.SymbolId.Generator.Visit(Microsoft.CodeAnalysis.ISymbol symbol) Unknown
Microsoft.CodeAnalysis.Workspaces.dll!Microsoft.CodeAnalysis.SymbolId.Generator.EncodeGenericTypeInfo(Microsoft.CodeAnalysis.INamedTypeSymbol symbol) Unknown
Based on the stacktrace and the classes that crash visual studio, I expect that it has something to do with generic types and recursive generic type constraints.
e.g. we have a class ViewModelBase
Unfortunately, I haven't been able to make a small example project that fails to show this defect.
I am running VS2015-Update 3 on Windows 10 x64
I am also experiencing this problem with 4-5 crashes in 30 mins today. I don't have a minimal repro yet, but I am working with a recursive generic type definition. Specifically Database<T>
from Dapper Rainbow.
The dapper type looks like:
``` c#
public abstract partial class Database
{
...
}
And my usage that crashes looks like
``` c#
public class DeviceDB : Database<DeviceDB>
{
public Table<Telem> Telemetry {get; }
}
After I declare an implementing class the IDE will lock up and crash.
If I edit the file from notepad and declare the class then VS will work, but as soon as i try to work with the new type the IDE locks and crashes.
When i tried a new project to isolate the crash and declared my own abstract CRTP type i could not repro it.
@owoudenberg Did downgrading to Update 2 work safely for you? I'm concerned about what @davidroth said.
I believe this is resolved with this PR: https://github.com/dotnet/roslyn/pull/12311
@Pilchie Can you fix be rolled into a microupdate?
@CyrusNajmabadi That's the current plan.
However, @davidroth - I'm not sure that your issue is the same, since your crash is in Microsoft.CodeAnalysis.CSharp.ni.dll, and this stackoverflow is in Microsoft.CodeAnalysis.Workspaces.dll (usually).
@davidroth Can you post the callstack from the ".NET Runtime" event or the info from the Windows Error Reporting (event id 1001) right around the time of the crash?
Alternatively, can you capture a minidump with heap per http://blogs.msdn.com/b/kirillosenkov/archive/2008/12/07/how-to-debug-crashes-and-hangs.aspx and share it with us?
I think I found an easy way to reproduce this bug:
using System.ServiceModel;
namespace ConsoleApplication5
{
public interface IVSCrash
{
void Crash();
}
public class VSCrash : ClientBase<IVSCrash>, IVSCrash
{
public void Crash()
{
}
}
}
However it will crash in Microsoft.CodeAnalysis.Workspaces.ni.dll... But the similar client proxy class in our big work project crashes in Microsoft.CodeAnalysis.CSharp.ni.dll
I attached 2 events exported from Event Log and corresponding WER-files.
Ok, I reproduced crash in Microsoft.CodeAnalysis.CSharp.ni.dll and finally figured out how to save minidump. But it is ~900Mb. @Pilchie What is the best way to share it with you?
If it helps, here is the callstack:
> mscorlib.dll!System.Collections.Generic.ObjectEqualityComparer<System.__Canon>.GetHashCode(System.__Canon obj) Unknown
mscorlib.dll!System.Collections.Concurrent.ConcurrentDictionary<Microsoft.CodeAnalysis.CSharp.Symbol, Microsoft.CodeAnalysis.CSharp.Symbol>.TryGetValue(Microsoft.CodeAnalysis.CSharp.Symbol key, out Microsoft.CodeAnalysis.CSharp.Symbol value) Unknown
mscorlib.dll!System.Collections.Concurrent.ConcurrentDictionary<Microsoft.CodeAnalysis.CSharp.Symbol, Microsoft.CodeAnalysis.CSharp.Symbol>.GetOrAdd(Microsoft.CodeAnalysis.CSharp.Symbol key, System.Func<Microsoft.CodeAnalysis.CSharp.Symbol, Microsoft.CodeAnalysis.CSharp.Symbol> valueFactory) Unknown
Microsoft.CodeAnalysis.CSharp.dll!Microsoft.CodeAnalysis.CSharp.Symbols.Retargeting.RetargetingModuleSymbol.RetargetingSymbolTranslator.Retarget(Microsoft.CodeAnalysis.CSharp.Symbols.NamespaceSymbol ns) Unknown
Microsoft.CodeAnalysis.CSharp.dll!Microsoft.CodeAnalysis.CSharp.Symbols.Retargeting.RetargetingModuleSymbol.RetargetingSymbolTranslator.VisitNamespace(Microsoft.CodeAnalysis.CSharp.Symbols.NamespaceSymbol symbol, Microsoft.CodeAnalysis.CSharp.Symbols.Retargeting.RetargetOptions options) Unknown
Microsoft.CodeAnalysis.CSharp.dll!Microsoft.CodeAnalysis.CSharp.Symbols.NamespaceSymbol.Accept<Microsoft.CodeAnalysis.CSharp.Symbols.Retargeting.RetargetOptions, System.__Canon>(Microsoft.CodeAnalysis.CSharp.CSharpSymbolVisitor<Microsoft.CodeAnalysis.CSharp.Symbols.Retargeting.RetargetOptions, System.__Canon> visitor, Microsoft.CodeAnalysis.CSharp.Symbols.Retargeting.RetargetOptions argument) Unknown
Microsoft.CodeAnalysis.CSharp.dll!Microsoft.CodeAnalysis.CSharp.Symbols.Retargeting.RetargetingModuleSymbol.RetargetingSymbolTranslator.Retarget(Microsoft.CodeAnalysis.CSharp.Symbol symbol) Unknown
Microsoft.CodeAnalysis.CSharp.dll!Microsoft.CodeAnalysis.CSharp.Symbols.Retargeting.RetargetingNamespaceSymbol.ContainingSymbol.get() Unknown
Microsoft.CodeAnalysis.CSharp.dll!Microsoft.CodeAnalysis.CSharp.Symbol.Microsoft.CodeAnalysis.ISymbol.ContainingSymbol.get() Unknown
Microsoft.CodeAnalysis.Workspaces.dll!Microsoft.CodeAnalysis.SymbolId.Generator.VisitNamespace(Microsoft.CodeAnalysis.INamespaceSymbol symbol) Unknown
Microsoft.CodeAnalysis.Workspaces.dll!Microsoft.CodeAnalysis.SymbolId.Generator.Visit(Microsoft.CodeAnalysis.ISymbol symbol) Unknown
Microsoft.CodeAnalysis.Workspaces.dll!Microsoft.CodeAnalysis.SymbolId.Generator.VisitNamespace(Microsoft.CodeAnalysis.INamespaceSymbol symbol) Unknown
Microsoft.CodeAnalysis.Workspaces.dll!Microsoft.CodeAnalysis.SymbolId.Generator.Visit(Microsoft.CodeAnalysis.ISymbol symbol) Unknown
Microsoft.CodeAnalysis.Workspaces.dll!Microsoft.CodeAnalysis.SymbolId.Generator.VisitNamedType(Microsoft.CodeAnalysis.INamedTypeSymbol symbol) Unknown
Microsoft.CodeAnalysis.Workspaces.dll!Microsoft.CodeAnalysis.SymbolId.Generator.Visit(Microsoft.CodeAnalysis.ISymbol symbol) Unknown
Microsoft.CodeAnalysis.Workspaces.dll!Microsoft.CodeAnalysis.SymbolId.Generator.EncodeGenericTypeInfo(Microsoft.CodeAnalysis.INamedTypeSymbol symbol) Unknown
<there were lots of the same calls to Workspaces methods Visit*>
@AlgorithmsAreCool, yes you can rollback to update2. don't use the system-restore, but the installer.
@Pilchie It looks like @v1rusw0rm has already collected all necessary crash dumps for you ;)
In which timeframe can we expect a microupdate? (Days/Weeks?) Will the microupdate popup in VS?
However, If you can publish a VSIX before the microupdate I would also be willing to test it ;)
@Pilchie, i've tried the changes on your Fix235912-symbolid-stackoverflow branch and it solved my crashes.
Same here. The Fix235912-symbolid-stackoverflow branch fixes both crashes for me: in Microsoft.CodeAnalysis.CSharp.ni.dll as well as in Microsoft.CodeAnalysis.Workspaces.ni.dll.
Glad to hear it everyone! @v1rusw0rm It looks like the crash in Microsoft.CodeAnalysis.CSharp.ni.dll is actually the same thing, you just happened to run out of stack space in a different method. Can you email me at [email protected] and I'll set up somewhere for you to upload just to make sure?
We'll be pushing out the microupdate in a few weeks - but in the meantime we should have a signed VSIX you can use by EOD Tuesday (Monday is a holiday here in the US).
@Pilchie I also tested Fix235912-symbolid-stackoverflow
and it looks good on our side as well - as expected :+1: We now use our own build until you release the microupdate - this new ms open source world is awesome :tada:
@owoudenberg @v1rusw0rm Does "add using statement" work on your machine with Fix235912-symbolid-stackoverflow
installed?
This takes forever since I updated to it. The progress bar opens:
and it completes several minutes later ...
@Pilchie Is this issue known?
_Edit_: Same issue when generating fields from a constructor parameter.
However it does only occur in our big solution, i don't see this delay in a small demo project.
@davidroth No, haven't seen that delay with adding using statements.
@Pilchie @owoudenberg I found the reason for the delay => I was using a debug build.
When building roslyn with /p:Configuration=Release
and installing the resulting Release vsix, I don't see these delays. So I guess the huge delay was probably because of several heavyweight assertions/loggings which are only present in debug builds + missing optimizations. (Although its interesting that the delay is that huge ... )
@davidroth - you are almost certainly hitting this code, which verifies that our code fixes don't introduce new errors.
This issue is really a nightmare for us. Is there any chance to get a temp fix ASAP?
@xeneo I feel your pain so I have uploaded my self builded vsix.
You can download it here: Roslyn.VisualStudio.Setup.vsix (MD5: 33e4982535aa4903cfc53064ec8036ad
)
Just install it, restart vs, and the bug will be gone.
@davidroth Thank you so much! Your vsix works like a charm.
@davidroth Thank you! It works perfectly
I was also experiencing this issue. The vsix solution @davidroth created solves the problem. Thank you sir!
@davidroth Wer'e experiencing a crash in the IDE when editing cshtml/razor files when the vsix is installed. Looks like a file is missing : Microsoft.VisualStudio.ProjectSystem.DNX.14.0, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. Any Idea?
That is a different issue. That file isn't part of Roslyn. @barrytang ?
What version of .NET Core tooling are you on? Have you tried using the latest from https://dot.net?
The original stack overflow is fixed with #12311, and the microupdate containing that fix is live at https://msdn.microsoft.com/library/mt752379.
This didn;t fix the problem for me. I installed update 3 from update 2 and then the problems cames, what i did was to install fix you provided - didn;t work. Then i completly uinstalled VS and then installed again. I think i tried everything else what found on intneret. having big troubles as i cannot develop! Please of help: I checked windows 10 events viewer and i found out this:
The application name causes confusion: devenv.exe, version: 14.0.25420.1, timestamp: 0x57685d85 The name of the module causing the error: mscorlib.ni.dll version: 4.6.1586.0, time stamp: 0x575a1299 Exception code: 0xc00000fd The offset error 0x0039f4e3 Process ID causing the error: 0x38e4 Hour run the application causing the error: 0x01d219f6057461d5 The application path causing the error: C: \ Program Files (x86) \ Microsoft Visual Studio 14.0 \ Common7 \ IDE \ devenv.exe The path of the module causing the error: C: \ WINDOWS \ assembly \ NativeImages_v4.0.30319_32 \ mscorlib \ 40571abae9422cd2ca6fafbbde1c3cdc \ mscorlib.ni.dll Report ID: 0956078b-1b3d-4b24-bac7-3f39cc4c53ea The full name of the package causing the error: The application ID terms of the package causing the error:
Most helpful comment
The original stack overflow is fixed with #12311, and the microupdate containing that fix is live at https://msdn.microsoft.com/library/mt752379.