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

Notification

Icon
Error

NCrunch 1.41b remains Running after closing Visual Studio 2012
CreepyGnome
#1 Posted : Wednesday, September 12, 2012 7:58:30 PM(UTC)
Rank: Member

Groups: Registered
Joined: 8/21/2012(UTC)
Posts: 22
Location: Arizona

Thanks: 2 times
Was thanked: 5 time(s) in 5 post(s)
Using RTM Visual Studio 2012 with NCrunch 1.41b on Windows Server 2008 R2 workstation.

When I close Visual Studio 2012 by the usual means the UI goes away, but NCrunch remains open with at least one but sometimes as many as 4 instances running. These are preventing the devenv.exe from fulling closing. This happens almost everytime I close VS2012 with NCrunch enabled.
Remco
#2 Posted : Wednesday, September 12, 2012 8:59:07 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
NCrunch contains cleanup code that spawns a taskrunner process which waits for devenv.exe to exit before it fully terminates. This is part of the intended behaviour (to make sure that workspaces are fully cleaned up on exit). A side-effect of this behaviour is that it can make NCrunch appear to be preventing devenv.exe from closing, where actually devenv.exe is preventing NCrunch from closing, if this makes sense.

I'm not saying with certainty that NCrunch isn't to blame, as there have been a history of problems in this area (although no known such issues still exist). If you have time, I'd recommend you try uninstalling NCrunch and experimenting with your IDE to see if the devenv.exe process continues to hang around after termination without NCrunch loaded. This is a VERY common problem for VS packages/plugins in general, as reliably managing cleanup during VS termination is difficult to do.

Otherwise, a useful way to gain more information about the lockup is to attach a debugger to the hung devenv.exe process and examine the list of running threads. Do you see recognisable namespaces in the stack trace for any of the running threads?
CreepyGnome
#3 Posted : Wednesday, September 12, 2012 9:19:47 PM(UTC)
Rank: Member

Groups: Registered
Joined: 8/21/2012(UTC)
Posts: 22
Location: Arizona

Thanks: 2 times
Was thanked: 5 time(s) in 5 post(s)
I would suspect NCrunch for 2012 since its still beta, because if open a solution that doesn't have NCrunch enabled VS2012 closes fine and no NCrunch instances where opened and when it does happen I have let it sit for 30 minutes and they stayed open in Task Manager.

So my main solution I am working in lately has 20 projects 8 of which are test projects with over 200 tests and then I wait for NCrunch to finish its little process (based on icon in status bar) then I close VS. It stays open with at least one NCrunch process running. Sometimes when it does work correctly, I have noticed devenv.exe goes away but one NCrunch will stay open for about a minute or two and then it will go away when it does work. This problem seems to be more reproducable when I have had two Visual Studio 2012 instances running and between 2-4 Visual Studio 2010 instances running. Then when I close them all down only one VS2012 devenv.exe and a few ncrunches stay around and never close.

Are you saying you cannot reproduce this situation on Visual Studio 2012 with NCrunch 1.41b?

Next time I notice it happening if I have time I will try to remember to attach to the devenv.exe process and review the running threads. I will update this thread when I do unless you post you where able to reproduce it before hand.
Remco
#4 Posted : Thursday, September 13, 2012 11:21:35 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
The leftover process hanging around for about a minute after devenv.exe closing is by design, although the hanging of devenv.exe process is not.

I develop daily with VS2012 using NCrunch, and so far I haven't seen this issue occur. The behaviour you've described suggests it may be caused by a race condition of some kind. Note that the enabling/disabling of NCrunch does not necessarily mean that NCrunch is the direct cause of the problem, as it could simply be that the race condition occurs while your system is under a heavy load (which is a state NCrunch could contribute to).

I'd be very interested to know what you see with a debugger attached.

Also, does killing all the nCrunch taskrunners using process manager resolve the issue when it occurs?
CreepyGnome
#5 Posted : Thursday, September 13, 2012 6:13:59 PM(UTC)
Rank: Member

Groups: Registered
Joined: 8/21/2012(UTC)
Posts: 22
Location: Arizona

Thanks: 2 times
Was thanked: 5 time(s) in 5 post(s)
Well since posted this issue and I have been monitoring more the issue diligently, I can't reproduce it. Which is odd because it was happening fairly frequently which is what prompted me to post. The next time I it happens I will attach a debugger to and see what is holding it up, if it appears to be NCrunch I will update the thread, otherwise I will chalk it up to a odd Windows Hiccup for a bit.

Thanks for your help.
1 user thanked CreepyGnome for this useful post.
Remco on 9/13/2012(UTC)
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.043 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download