Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Microsoft Visual Studio is Busy. Forever.
akvochick
#1 Posted : Friday, June 23, 2017 2:28:24 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 6/23/2017(UTC)
Posts: 5
Location: United States of America

Thanks: 1 times
I had been having this issue with Visual Studio 2015. I start it up and it is totally unresponsive. Once in a while, I get a little popup notification that says "Microsoft Visual Studio is Busy". It's not using more than 2% CPU or more than a few hundred megabytes of memory. It doesn't seem to be doing anything at all. And it lasts forever. I once just put my laptop on the passenger seat on the way home and let it run and it never completed.

I didn't know what caused it. I eventually figured out how to fix it.
1. Close my rather large solution (I have to use "End Task" in Task Manager)
2. Open a smaller solution.
3. Rebuild the smaller solution.
4. Close the smaller solution.
5. Reopen the large solution.

It doesn't work EVERY time, but it works often enough that I can get back to work.

For unrelated reasons, I shut off NCrunch a couple months ago. This morning, I turned it back on. There was an upgrade available so I installed that. After VS restarted, "Visual Studio is Busy". I realized, I haven't seen that problem since I shut off NCrunch, so now I have a suspect.

What information do you need from me to figure out what's going on?
Remco
#2 Posted : Friday, June 23, 2017 11:37:25 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,123

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
Hi,

Try this:

1. Run your VS2015 until it crashes in the way you've described
2. Load up a second of instance of VS2015 and don't open a solution, hopefully this won't crash. If it does, load another up until you get a working instance.
3. Using the second instance, attach the debugger onto the first instance of devenv.exe
4. Break into the process. Open the list of running threads, find the main thread
5. Open up the stack trace, copy paste the contents of the stack trace into this forum
1 user thanked Remco for this useful post.
akvochick on 7/29/2017(UTC)
akvochick
#3 Posted : Saturday, July 29, 2017 1:34:19 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 6/23/2017(UTC)
Posts: 5
Location: United States of America

Thanks: 1 times
> mscorlib.dll!System.Threading.WaitHandle.InternalWaitOne(System.Runtime.InteropServices.SafeHandle waitableSafeHandle, long millisecondsTimeout, bool hasThreadAffinity, bool exitContext) Unknown
mscorlib.dll!System.Threading.WaitHandle.WaitOne(int millisecondsTimeout, bool exitContext) Unknown
mscorlib.dll!System.Threading.WaitHandle.WaitOne() Unknown
System.Management.Automation.dll!System.Management.Automation.Runspaces.PipelineBase.Invoke(System.Collections.IEnumerable input) Unknown
NuGetConsole.Host.PowerShell.dll!NuGetConsole.Host.PowerShell.Implementation.RunspaceDispatcher.InvokeCore.AnonymousMethod__0() Unknown
NuGetConsole.Host.PowerShell.dll!NuGetConsole.Host.PowerShell.Implementation.RunspaceDispatcher.WithLock(System.Action act) Unknown
NuGetConsole.Host.PowerShell.dll!NuGetConsole.Host.PowerShell.Implementation.RunspaceDispatcher.InvokeCore(System.Management.Automation.Runspaces.Pipeline pipeline, System.Collections.Generic.IEnumerable<object> inputs) Unknown
NuGetConsole.Host.PowerShell.dll!NuGetConsole.Host.PowerShell.Implementation.RunspaceDispatcher.Invoke(string command, object[] inputs, bool outputResults) Unknown
NuGetConsole.Host.PowerShell.dll!NuGetConsole.Host.PowerShell.Implementation.RunspaceDispatcher.ExecuteScript(string installPath, string scriptPath, NuGet.PackageManagement.VisualStudio.ScriptPackage package) Unknown
NuGetConsole.Host.PowerShell.dll!NuGetConsole.Host.PowerShell.Implementation.PowerShellHost.ExecuteInitScriptsAsync() Unknown
mscorlib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start<NuGetConsole.Host.PowerShell.Implementation.PowerShellHost.<ExecuteInitScriptsAsync>d__60>(ref NuGetConsole.Host.PowerShell.Implementation.PowerShellHost.<ExecuteInitScriptsAsync>d__60 stateMachine) Unknown
NuGetConsole.Host.PowerShell.dll!NuGetConsole.Host.PowerShell.Implementation.PowerShellHost.ExecuteInitScriptsAsync() Unknown
NuGetConsole.Host.PowerShell.dll!NuGetConsole.Host.PowerShell.Implementation.PowerShellHost.Initialize.AnonymousMethod__0() Unknown
mscorlib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start<NuGetConsole.Host.PowerShell.Implementation.PowerShellHost.(ref NuGetConsole.Host.PowerShell.Implementation.PowerShellHost.<>c__DisplayClass57_0.<<Initialize>b__0>d stateMachine) Unknown
NuGetConsole.Host.PowerShell.dll!NuGetConsole.Host.PowerShell.Implementation.PowerShellHost.Initialize.AnonymousMethod__0() Unknown
Microsoft.VisualStudio.Threading.dll!Microsoft.VisualStudio.Threading.JoinableTaskFactory.RunAsync(System.Func<System.Threading.Tasks.Task> asyncMethod, bool synchronouslyBlocking, Microsoft.VisualStudio.Threading.JoinableTaskCreationOptions creationOptions, System.Delegate entrypointOverride) Unknown
NuGetConsole.Host.PowerShell.dll!NuGetConsole.Host.PowerShell.Implementation.PowerShellHost.Initialize(NuGetConsole.IConsole console) Unknown
NuGet.Console.dll!NuGetConsole.Implementation.Console.ConsoleDispatcher.Start.AnonymousMethod__0() Unknown
mscorlib.dll!System.Threading.Tasks.Task.InnerInvoke() Unknown
mscorlib.dll!System.Threading.Tasks.Task.Execute() Unknown
mscorlib.dll!System.Threading.Tasks.Task.ExecutionContextCallback(object obj) Unknown
mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Unknown
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Unknown
mscorlib.dll!System.Threading.Tasks.Task.ExecuteWithThreadLocal(ref System.Threading.Tasks.Task currentTaskSlot) Unknown
mscorlib.dll!System.Threading.Tasks.Task.ExecuteEntry(bool bPreventDoubleExecution) Unknown
mscorlib.dll!System.Threading.Tasks.TaskScheduler.TryExecuteTask(System.Threading.Tasks.Task task) Unknown
Microsoft.VisualStudio.Shell.UI.Internal.dll!Microsoft.VisualStudio.Services.TaskSchedulerService.VsUIThreadBlockableTaskScheduler.DoOneTask() Unknown
Microsoft.VisualStudio.Shell.UI.Internal.dll!Microsoft.VisualStudio.Services.TaskSchedulerService.VsUIBackgroundPriorityScheduler.ProcessQueue() Unknown
Microsoft.VisualStudio.Shell.UI.Internal.dll!Microsoft.VisualStudio.Services.TaskSchedulerService.VsUIBackgroundPriorityScheduler.OnTaskQueued.AnonymousMethod__6_0() Unknown
WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback, object args, int numArgs) Unknown
WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.TryCatchWhen(object source, System.Delegate callback, object args, int numArgs, System.Delegate catchHandler) Unknown
WindowsBase.dll!System.Windows.Threading.DispatcherOperation.InvokeImpl() Unknown
WindowsBase.dll!System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(object state) Unknown
mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Unknown
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Unknown
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) Unknown
WindowsBase.dll!MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext executionContext, System.Threading.ContextCallback callback, object state) Unknown
WindowsBase.dll!System.Windows.Threading.DispatcherOperation.Invoke() Unknown
WindowsBase.dll!System.Windows.Threading.Dispatcher.ProcessQueue() Unknown
WindowsBase.dll!System.Windows.Threading.Dispatcher.WndProcHook(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled) Unknown
WindowsBase.dll!MS.Win32.HwndWrapper.WndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled) Unknown
WindowsBase.dll!MS.Win32.HwndSubclass.DispatcherCallbackOperation(object o) Unknown
WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback, object args, int numArgs) Unknown
WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.TryCatchWhen(object source, System.Delegate callback, object args, int numArgs, System.Delegate catchHandler) Unknown
WindowsBase.dll!System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority priority, System.TimeSpan timeout, System.Delegate method, object args, int numArgs) Unknown
WindowsBase.dll!MS.Win32.HwndSubclass.SubclassWndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam) Unknown
akvochick
#4 Posted : Saturday, July 29, 2017 1:37:21 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 6/23/2017(UTC)
Posts: 5
Location: United States of America

Thanks: 1 times
I had turned off NCrunch since I first posted. I turned it on a couple days ago. This morning, I got the dreaded hang. Here is that stack trace you requested. Thanks!
akvochick
#5 Posted : Saturday, July 29, 2017 2:01:50 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 6/23/2017(UTC)
Posts: 5
Location: United States of America

Thanks: 1 times
I also captured a dump file that's about 200MB 7zip'd. If you want that, let me know where to send it.
Remco
#6 Posted : Saturday, July 29, 2017 10:19:01 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,123

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
akvochick;10889 wrote:
I also captured a dump file that's about 200MB 7zip'd. If you want that, let me know where to send it.


It would be very useful to see this dump. Unfortunately I don't have anywhere for you to easily send such a large file. Do you have a dropbox account or anywhere you might be able to post it for me?

Although I understand the pattern of this problem suggests it's being caused by NCrunch, the stack trace of the hung main thread doesn't seem to be related to NCrunch in any way. My feeling at the moment is that this problem is actually a problem in VS itself that is being indirectly triggered by NCrunch being resident. Sometimes the smallest adjustment to an environment can cause sequence changes that make race conditions surface. I should be able to know for certain if I can take a look at the minidump.
akvochick
#7 Posted : Tuesday, August 1, 2017 1:58:50 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 6/23/2017(UTC)
Posts: 5
Location: United States of America

Thanks: 1 times
I sent you a link to the dump file via the website contact form. Thanks.
Remco
#8 Posted : Tuesday, August 1, 2017 11:58:09 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,123

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
Thanks for the dump file.

This appears to me to be a deadlock between the main thread and a background thread somewhere in Nuget/Powershell (threads 14604 and 15980). Because the code here is all internal MS code, I am unfamiliar with its purpose or function. I can say with confidence that this crash is not the fault of NCrunch. It's possible that by having NCrunch loaded, the sequence of events inside your IDE is different and this causes the deadlock to surface.

I recommend sharing this with Microsoft. With the dump file, they'll likely have a good chance of being able to figure this out and hopefully resolve it.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.073 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download