Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visual Studio crashes when I quit debugging #70

Closed
dfoverdx opened this issue Apr 18, 2015 · 7 comments · Fixed by #526
Closed

Visual Studio crashes when I quit debugging #70

dfoverdx opened this issue Apr 18, 2015 · 7 comments · Fixed by #526

Comments

@dfoverdx
Copy link

I'm running Visual Studio 2013 Community. I've previously had VS Express 2012 and 2013 (various versions) and tried out VS 2015 Preview and CTP 6 when VS started crashing on me.

Since then I uninstalled all versions of VS, though \Program Files (x86)\Microsoft Visual Studio X.0\ directories exist for 10, 11, 12, and 14 still. I then installed VS Community 2013 "fresh" (as fresh as it can be with those lingering files).

I installed NTVS for VS 2013 (after uninstalling it, and then removing \Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Node.js Tools* manually, since uninstalling did not do it). Now I can repro this crashing every time with the following steps (before it may have been intermittent?):

Open VS, create a new "Basic Node.js Express 4 Application" project, press F5. The browser pops up with the expected text. Close the Browser. Stop debugging. VS crashes.

It's quite frustrating. Until a couple days ago (when I started messing with the Babel package, attempting to get ECMAScript 6 features to work), everything was working great.

Let me know what more information you need.

Thanks!

@mousetraps
Copy link
Contributor

Since VS crashed, there should be an entry in the Windows event viewer. Mind providing the relevant info?

@mousetraps
Copy link
Contributor

Any update on this, or are you still blocked?

@dfoverdx
Copy link
Author

Sorry for the late reply. I've just been using a different (inferior) editor to unblock me.

Here's the error that pops up when I get the null reference exception:

Problem signature:
Problem Event Name: CLR20r3
Problem Signature 01: devenv.exe
Problem Signature 02: 12.0.31101.0
Problem Signature 03: 54548724
Problem Signature 04: Microsoft.NodejsTools.Analysis
Problem Signature 05: 1.0.30324.1
Problem Signature 06: 55124335
Problem Signature 07: 6a
Problem Signature 08: 0
Problem Signature 09: System.NullReferenceException
OS Version: 6.3.9600.2.0.0.256.103
Locale ID: 1033
Additional Information 1: 5861
Additional Information 2: 5861822e1919d7c014bbb064c64908b2
Additional Information 3: a10f
Additional Information 4: a10ff7d2bb2516fdc753f9c34fc3b069

There are two events in event viewer.

First event:

<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
    <System>
        <Provider Name=".NET Runtime" /> 
        <EventID Qualifiers="0">1026</EventID> 
        <Level>2</Level> 
        <Task>0</Task> 
        <Keywords>0x80000000000000</Keywords> 
        <TimeCreated SystemTime="2015-05-13T15:13:46.000000000Z" /> 
        <EventRecordID>143223</EventRecordID> 
        <Channel>Application</Channel> 
        <Computer>jordan-pc</Computer> 
        <Security /> 
    </System>
    <EventData>
        <Data>
            Application: devenv.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.NullReferenceException Stack: at Microsoft.NodejsTools.Analysis.AnalysisUnit.AnalyzeWorker(Microsoft.NodejsTools.Analysis.Analyzer.DDG, System.Threading.CancellationToken) at Microsoft.NodejsTools.Analysis.Analyzer.DDG.Analyze(Microsoft.NodejsTools.Analysis.Deque`1<Microsoft.NodejsTools.Analysis.AnalysisUnit>, System.Threading.CancellationToken) at Microsoft.NodejsTools.Analysis.JsAnalyzer.AnalyzeQueuedEntries(System.Threading.CancellationToken) at Microsoft.NodejsTools.Intellisense.VsProjectAnalyzer+AnalysisQueue+GroupAnalysis.Analyze(System.Threading.CancellationToken) at Microsoft.NodejsTools.Intellisense.VsProjectAnalyzer+AnalysisQueue.Worker(System.Object) at System.Threading.ThreadHelper.ThreadStart_Context(System.Object) at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) at System.Threading.ThreadHelper.ThreadStart(System.Object)
        </Data> 
    </EventData>
</Event>

Second event:

<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
    <System>
        <Provider Name="Application Error" /> 
        <EventID Qualifiers="0">1000</EventID> 
        <Level>2</Level> 
        <Task>100</Task> 
        <Keywords>0x80000000000000</Keywords> 
        <TimeCreated SystemTime="2015-05-13T15:13:47.000000000Z" /> 
        <EventRecordID>143224</EventRecordID> 
        <Channel>Application</Channel> 
        <Computer>jordan-pc</Computer> 
        <Security /> 
    </System>
    <EventData>
        <Data>devenv.exe</Data> 
        <Data>12.0.31101.0</Data> 
        <Data>54548724</Data> 
        <Data>unknown</Data> 
        <Data>0.0.0.0</Data> 
        <Data>00000000</Data> 
        <Data>c0000005</Data> 
        <Data>1298e90c</Data> 
        <Data>107c</Data> 
        <Data>01d08d8edac5642b</Data> 
        <Data>D:\Visual Studio\Community 2013\Common7\IDE\devenv.exe</Data> 
        <Data>unknown</Data> 
        <Data>a68ab7da-f982-11e4-beee-bc5ff48454c5</Data> 
        <Data /> 
        <Data /> 
    </EventData>
</Event>

I don't know if it's relevant, but I installed VS to a secondary drive since my primary is a small SSD and rapidly running out space. I know it shouldn't make a difference, but that doesn't mean it doesn't.

Also, the repro steps I posted above didn't repro this time. However, it did crash shortly after creating the project.

@mousetraps
Copy link
Contributor

Thx for reporting this. Try deleting your .ntvs_analysis.dat file (renaming is better so we can use it to debug) and re-opening the project to work around the issue for now. Other folks have had good luck with creating a new project from existing, but hopefully you won't have to do that.

@mousetraps mousetraps added this to the July milestone Jul 6, 2015
@mousetraps mousetraps modified the milestones: July, August Jul 24, 2015
@billti billti modified the milestones: September, August Sep 11, 2015
@hoanhtien
Copy link
Contributor

Call stack:

Application: devenv.exe 
Framework Version: v4.0.30319 
Description: The process was terminated due to an unhandled exception. 
Exception Info: System.NullReferenceException Stack: 
at Microsoft.NodejsTools.Analysis.AnalysisUnit.AnalyzeWorker(Microsoft.NodejsTools.Analysis.Analyzer.DDG, System.Threading.CancellationToken) 
at Microsoft.NodejsTools.Analysis.Analyzer.DDG.Analyze(Microsoft.NodejsTools.Analysis.Deque`1<Microsoft.NodejsTools.Analysis.AnalysisUnit>, System.Threading.CancellationToken) 
at Microsoft.NodejsTools.Analysis.JsAnalyzer.AnalyzeQueuedEntries(System.Threading.CancellationToken) 
at Microsoft.NodejsTools.Intellisense.VsProjectAnalyzer+AnalysisQueue+GroupAnalysis.Analyze(System.Threading.CancellationToken) 
at Microsoft.NodejsTools.Intellisense.VsProjectAnalyzer+AnalysisQueue.Worker(System.Object) at System.Threading.ThreadHelper.ThreadStart_Context(System.Object) 
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) 
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) 
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) 
at System.Threading.ThreadHelper.ThreadStart(System.Object)

In the current code, DDG.Analyze() does not directly call AnalysisUnit.AnalyzeWorker(): /~https://github.com/Microsoft/nodejstools/blob/35817ffdaa1797f95628a22f588fc3ed885f884b/Nodejs/Product/Analysis/Analysis/Analyzer/DDG.cs#L37. Does this mean user is using an older version of NTVS?

@mousetraps
Copy link
Contributor

@hoanhtien This is more likely a difference between Debug and Release mode. In Release mode, the compiler performs some extra optimizations that it doesn't perform in Debug mode. In this case, it looks like there was some inlining which caused a missing entry in the stack trace.

@mousetraps mousetraps assigned mousetraps and unassigned hoanhtien Oct 10, 2015
@mousetraps mousetraps modified the milestones: September, October Oct 11, 2015
mousetraps added a commit to mousetraps/nodejstools that referenced this issue Oct 11, 2015
- Fix potential NullReferenceExceptions
mousetraps added a commit to mousetraps/nodejstools that referenced this issue Oct 12, 2015
- Fix potential NullReferenceExceptions
mousetraps added a commit that referenced this issue Oct 14, 2015
#70 Visual Studio crashes when I quit debugging
@mousetraps
Copy link
Contributor

This fix is now available in our latest dev build - mind verifying it works on your end?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment