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 crashed in IncrementalAnalyzerProcessor #26171

Closed
nigurr opened this issue Apr 16, 2018 · 15 comments
Closed

Visual Studio crashed in IncrementalAnalyzerProcessor #26171

nigurr opened this issue Apr 16, 2018 · 15 comments
Assignees
Milestone

Comments

@nigurr
Copy link

nigurr commented Apr 16, 2018

Version Used: 15.7 Preview 3

Steps to Reproduce:

  1. Opening any project/solution crashes VS

Stack trace:

Application: devenv.exe
Framework Version: v4.0.30319
Description: The application requested process termination through System.Environment.FailFast(string message).
Message: System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'StreamJsonRpc.JsonRpc'.
at Microsoft.Verify.NotDisposed(IDisposableObservable disposedValue, String message)
at StreamJsonRpc.JsonRpc.d__671.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) at Microsoft.VisualStudio.LanguageServices.Remote.ServiceHubRemoteHostClient.<CreateWorkerAsync>d__11.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.LanguageServices.Remote.ServiceHubRemoteHostClient.Connections.<RetryRemoteCallAsync>d__02.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.LanguageServices.Remote.ServiceHubRemoteHostClient.d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.LanguageServices.Remote.RemoteHostClientFactory.d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.LanguageServices.Remote.RemoteHostClientServiceFactory.RemoteHostClientService.d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.CodeAnalysis.Remote.RemoteHostClientExtensions.d__23.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.CodeAnalysis.SolutionCrawler.SolutionCrawlerRegistrationService.WorkCoordinator.IncrementalAnalyzerProcessor.NormalPriorityProcessor.d__37.MoveNext()
Stack:
at System.Environment.FailFast(System.String, System.Exception)
at Microsoft.CodeAnalysis.FailFast.OnFatalException(System.Exception)
at Microsoft.CodeAnalysis.ErrorReporting.FatalError.Report(System.Exception, System.Action1<System.Exception>) at Microsoft.CodeAnalysis.ErrorReporting.FatalError.ReportUnlessCanceled(System.Exception) at Microsoft.CodeAnalysis.SolutionCrawler.SolutionCrawlerRegistrationService+WorkCoordinator+IncrementalAnalyzerProcessor+NormalPriorityProcessor+<ResetStatesAsync>d__37.MoveNext() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task) at Microsoft.CodeAnalysis.SolutionCrawler.SolutionCrawlerRegistrationService+WorkCoordinator+IncrementalAnalyzerProcessor+NormalPriorityProcessor+<ResetStatesAsync>d__37.MoveNext() at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[Microsoft.CodeAnalysis.SolutionCrawler.SolutionCrawlerRegistrationService+WorkCoordinator+IncrementalAnalyzerProcessor+NormalPriorityProcessor+<ResetStatesAsync>d__37, Microsoft.CodeAnalysis.Features, Version=2.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<ResetStatesAsync>d__37 ByRef) at Microsoft.CodeAnalysis.SolutionCrawler.SolutionCrawlerRegistrationService+WorkCoordinator+IncrementalAnalyzerProcessor+NormalPriorityProcessor.ResetStatesAsync() at Microsoft.CodeAnalysis.SolutionCrawler.SolutionCrawlerRegistrationService+WorkCoordinator+IncrementalAnalyzerProcessor+NormalPriorityProcessor+<ExecuteAsync>d__17.MoveNext() at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[Microsoft.CodeAnalysis.SolutionCrawler.SolutionCrawlerRegistrationService+WorkCoordinator+IncrementalAnalyzerProcessor+NormalPriorityProcessor+<ExecuteAsync>d__17, Microsoft.CodeAnalysis.Features, Version=2.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<ExecuteAsync>d__17 ByRef) at Microsoft.CodeAnalysis.SolutionCrawler.SolutionCrawlerRegistrationService+WorkCoordinator+IncrementalAnalyzerProcessor+NormalPriorityProcessor.ExecuteAsync() at Microsoft.CodeAnalysis.SolutionCrawler.IdleProcessor+<ProcessAsync>d__12.MoveNext() at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.InvokeMoveNext(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.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run() at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef) at System.Threading.Tasks.Task.FinishContinuations() at System.Threading.Tasks.Task.FinishStageThree() at System.Threading.Tasks.Task1[[System.Threading.Tasks.VoidTaskResult, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].TrySetResult(System.Threading.Tasks.VoidTaskResult)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1[[System.Threading.Tasks.VoidTaskResult, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].SetResult(System.Threading.Tasks.VoidTaskResult) at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1[[System.Threading.Tasks.VoidTaskResult, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].SetResult(System.Threading.Tasks.Task1<System.Threading.Tasks.VoidTaskResult>) at Microsoft.CodeAnalysis.SolutionCrawler.IdleProcessor+<WaitForIdleAsync>d__11.MoveNext() at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.InvokeMoveNext(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.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run() at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef) at System.Threading.Tasks.Task.FinishContinuations() at System.Threading.Tasks.Task.FinishStageThree() at System.Threading.Tasks.Task1[[System.Threading.Tasks.VoidTaskResult, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].TrySetResult(System.Threading.Tasks.VoidTaskResult)
at System.Threading.Tasks.Task+DelayPromise.Complete()
at System.Threading.Tasks.Task+<>c.b__274_1(System.Object)
at System.Threading.TimerQueueTimer.CallCallbackInContext(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.TimerQueueTimer.CallCallback()
at System.Threading.TimerQueueTimer.Fire()
at System.Threading.TimerQueue.FireNextTimers()
at System.Threading.TimerQueue.AppDomainTimerCallback()

I can share the repro machine/dump if required.

@jcouv jcouv added the Area-IDE label Apr 16, 2018
@heejaechang
Copy link
Contributor

Hi Thank you for reporting the issue?

can you share logs in %temp%\servicehub\logs? looks like some setup is messed up. the callstack shows VS is trying to start out of proc process and that failed to be started.

@heejaechang
Copy link
Contributor

heejaechang commented Apr 17, 2018

@jimmy9988 En-Shuo, have you reported this issue to FSharp team? it looks like somehow FSharp setup puts this in devenv.exe.config

			<dependentAssembly>
				<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
				<codeBase version="10.0.0.0" href="C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\FSharp\Newtonsoft.Json.dll"/>
			</dependentAssembly>

but some VS drop doesn't have newtonsoft.json.dll in FSharp directory. causing everything that uses newtonsoft.json.dll in VS to fail.

another thing is that, it points to version 10.0.0.0 but config has binding redirect to 9.0.0.0

<dependentAssembly>
				<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
				<bindingRedirect oldVersion="1.0.0.0-9.0.0.0" newVersion="9.0.0.0"/>
			</dependentAssembly>

making 2 different versions of newtonsoft.json.dll to be used.

are these known issue?

tagging @jinujoseph @KevinRansom @brettfo

...

also, one of reliability bug @ivanbasov assigned to me (service hub failing to start) seems related to this.
https://devdiv.visualstudio.com/DevDiv/_workitems/edit/600984?src=WorkItemMention&src-action=artifact_link

@heejaechang
Copy link
Contributor

@nigurr can you check your directory (C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\FSharp\Newtonsoft.Json.dll) to see whether it has newtonsoft.json.dll ?

@heejaechang
Copy link
Contributor

here are service hub logs @nigurr shared. basically multiple services fail due to newtonsoft.json.dll issue.

...

04/17/2018 10:26:15 : Error : Error creating Microsoft.VisualStudio.ExtensionManager.ServiceModule.ExtensionManagerServiceModule instance of CLR service module 'extensionManager': System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. HResult='-2146232828'
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Microsoft.ServiceHub.HostLib.ServiceManager.CreateAndConfigureService(String name, Type serviceModuleType, WrappedStream stream)
===InnerException===
System.IO.FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified. HResult='-2147024894'
at Microsoft.VisualStudio.ExtensionManager.ServiceModule.ExtensionManagerServiceModule..ctor(Stream serviceHubStream, IServiceProvider serviceProvider)

04/17/2018 10:26:16 : Error : Error creating Microsoft.CodeAnalysis.Remote.RemoteHostService instance of CLR service module 'roslynRemoteHost': System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. HResult='-2146232828'
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Microsoft.ServiceHub.HostLib.ServiceManager.CreateAndConfigureService(String name, Type serviceModuleType, WrappedStream stream)
===InnerException===
System.IO.FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified. HResult='-2147024894'
at Microsoft.CodeAnalysis.Remote.RemoteHostService..ctor(Stream stream, IServiceProvider serviceProvider)
04/17/2018 10:26:16 : Error : Error creating Microsoft.CodeAnalysis.Remote.SnapshotService instance of CLR service module 'roslynSnapshot': System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. HResult='-2146232828'
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Microsoft.ServiceHub.HostLib.ServiceManager.CreateAndConfigureService(String name, Type serviceModuleType, WrappedStream stream)
===InnerException===
System.IO.FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified. HResult='-2147024894'
at Microsoft.CodeAnalysis.Remote.SnapshotService..ctor(Stream stream, IServiceProvider serviceProvider)

@nigurr
Copy link
Author

nigurr commented Apr 17, 2018

@heejaechang I am using latest public preview (15.7 PR 3) and Newton.Json doesn't exist in C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\Common7\IDE\CommonExtensions\Microsoft\FSharp

In 15.6 Stable release, the Newton.Json exists in that folder

@jinujoseph jinujoseph added this to the 15.7 milestone Apr 17, 2018
@jinujoseph
Copy link
Contributor

cc @Pilchie for info

@heejaechang
Copy link
Contributor

heejaechang commented Apr 17, 2018

@nigurr thank you

ping @KevinRansom @brettfo

according to @ivanbasov this is high priority

this is top crash in 15.7. preview 3 across the whole VS. Could you please take a look? It is a new regression started in 15.7 link

@Pilchie
Copy link
Member

Pilchie commented Apr 17, 2018

@brettfo deliberately removed that copy, so that F# would use the same version as everyone else, but it sounds like a the devenv.exe.config didn't get updated correctly?

@Pilchie Pilchie assigned brettfo and unassigned KevinRansom Apr 17, 2018
@Pilchie
Copy link
Member

Pilchie commented Apr 17, 2018

Can we get a VSTS bug on this for shiproom tracking ASAP please?

@brettfo
Copy link
Member

brettfo commented Apr 17, 2018

I think the Newtonsoft issue is a red herring. I've been running 15.7 previews for weeks and none of them have a copy of newtonsoft.json present.

The devenv.exe.config issue certainly needs to be fixed, but that would only cause issues at install time when everything is NGENed.

Edit:
The error logs above state that Newtonsoft.Json version 6 couldn't be found; F# used to ship (and doesn't any more) version 10, so this definitely isn't that issue.

@heejaechang
Copy link
Contributor

I investigated this issue with @nigurr before. once we either copied newtonsoft.json to the FSharp folder or remove newtonsoft.json codebase to the FSharp folder, VS worked as expected.

@jimmy9988 can you copy over newtonsoft.json to the FSharp folder and see whether VS still crash?

@brettfo
Copy link
Member

brettfo commented Apr 17, 2018

I have a new theory as to what happened:

  1. A VS preview was installed with F# support back when F# shipped Newtonsoft.Json.dll and the appropriate entry was added to the hive-local devenv.exe.config.
  2. The previews were upgraded past the point where Newtonsoft.Json.dll was no longer included.
  3. devenv.exe.config was never regenerated.

@jimmy9988 Can you try again with a clean install of VS and after deleting your hives under %localappdata%\Microsoft\VisualStudio\15.0* and %appdata%\Microsoft\VisualStudio\15.0*`? If the problem still persists then I think the next step is to look into how/when devenv.exe.config is regenerated.

@nigurr
Copy link
Author

nigurr commented Apr 18, 2018

@Pilchie I created DevDiv bug internally - 601243
Please update the details accordingly

@brettfo My machine has repro and we can investigate if you need any help (ping me)

@jinujoseph
Copy link
Contributor

watson vso issue tracking this 600984

@brettfo
Copy link
Member

brettfo commented May 2, 2018

Fixed in dotnet/fsharp#4764. The 15.7 release of VS will contain the fix.

@brettfo brettfo closed this as completed May 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants