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

NullReferenceException during Analysis #766

Closed
charliedavison opened this issue Mar 23, 2016 · 10 comments · Fixed by #781
Closed

NullReferenceException during Analysis #766

charliedavison opened this issue Mar 23, 2016 · 10 comments · Fixed by #781

Comments

@charliedavison
Copy link

Related issues: #753, #664

Hi,

Following on from the issues above, the original problem seems to have been fixed in the latest development build(3-22-2016), but has now been replaced with a different issue -

Application: devenv.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.NullReferenceException
   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)

This occurs with the same package.json file as the one given in #664 and occurred the moment I turned intellisense back on for node.js projects to test if the fix for the original items had worked.

Thanks

@mjbvz
Copy link
Contributor

mjbvz commented Mar 28, 2016

I'm looking into this, but still am unable to get a repo with the provided package.json. Do you also run into this issue with a new, empty project using the same package.json file? Are there any additional steps required to trigger this error?

It also would be helpful to know what line AnalyzeWorker crashes on. Do you see this information anywhere in the error logs?

@charliedavison
Copy link
Author

Hi,

Thanks for having another look! I've been trying to recreate the issue again this morning and am struggling to reproduce now as well.

I'll keep on it and see what I can find.

Thanks

@mjbvz
Copy link
Contributor

mjbvz commented Mar 29, 2016

I checked in a potential fix, but please reopen this issue if you get a reliable repo or run into a similar problem. A new preview build with the fix should be coming out shortly.

@charliedavison
Copy link
Author

charliedavison commented May 4, 2016

@mjbvz Unfortunately all of the developers on my team are still being plagued by this issue. Visual Studio is now crashing for all of us upwards of 10-15 times a day.

Crashes during actual development(text editing) now seem rarer, however the commonality between the crashes now seems to be that they occur during Git operations such as merges, or branch switching.

Can we reopen this issue and investigate further? I can provide any further information you require, please just let me know.

@mjbvz mjbvz reopened this May 4, 2016
@mjbvz
Copy link
Contributor

mjbvz commented May 4, 2016

A few questions for follow up:

  • Are you on the NTVS 1.2 Alpha now?
  • Are there any helpful logs or messages that provide the call stack of the crash? Is it the same location as before?
  • Are there any long path warnings when installing the packages? There's an option to show these under: Tools -> Options and then Node.js Tools -> General -> Check for paths that exceed the MAX_PATH length limit. See issue Node/npm MAX_PATH issues #69 for more info about MAX_PATH and some potential fixes.

As a mitigation for your team, you can try switching to use ES6 Intellisense preview. The full analyzer is a known source of instability.

Side note: the git connection may mean this is also related to: #542

@charliedavison
Copy link
Author

Thanks for reopening.

  • All developers are running NTVS 1.2.40329.01
  • The only call stack I can find is the same one that I posted when originally opening the issue.
  • Enabling the long path warnings does not show any issues. In case its relevant, we generally install packages outside of Visual Studio via command line. The Node_Modules folder is excluded from the project(Though one pesky module keeps reincluding itself and its Typings which we havent got to the bottom of yet.)

We are all using the full analyzer, will switch to the ES6 analyzer today and see how things go.

Thanks for your help

@charliedavison
Copy link
Author

charliedavison commented May 5, 2016

After a day of using ES6 Intellisense preview, I can say that unfortunately this does not help, but rather seems to shift the problem elsewhere. Now I do not experience the actual full crash of VS2015 but rather just an endless lock up when doing git operations forcing me to end the process manually. For now I have completely disabled intellisense and things seem to have improved.

I'll speak to the other members of the team tomorrow and see how they have fared. Just as a thought - would using the Visual Studio 15 preview be worth a shot?

@mjbvz
Copy link
Contributor

mjbvz commented May 5, 2016

Ok. Sad to hear that ES6 Preview Intellisense did not get you unblocked, but the issue you are running into with the hang sounds unrelated to the analyzer null dereference. Could you please open a separate bug to track this and we'll keep this issue focused on the analyzer NullReferenceException? Thanks.

Back on the Analyzer null problem, I'm just going to go ahead and add a few more null checks to this routine because I have no clue what else to do at this point without a local repo. It's not clear what is null in this function or how it got into this unexpected state.

@charliedavison
Copy link
Author

Sure, no problem. I'll do some more investigation and see if I can get any logs or extra information for the ES6 preview issue before I log it up.

Thanks again for your efforts to try and resolve this, eager to do as much as we can our end as well so just let me know if there's anything else we can provide.

@mousetraps
Copy link
Contributor

This is likely fixed by #926, and should be available in our latest dev build - http://github.com/Microsoft/nodejstools/releases

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

Successfully merging a pull request may close this issue.

3 participants