Frequent crashes (every few minutes)

Frequent crashes (every few minutes)

NCover Classic v3.4.16.6924 x64

I'm running a series of tests under ncover via nunit that basically all follow the same pattern:

1) Start 3-6 child process (I have ncover configured to only attach to a subset of them) 2) Verify the processes are started and responding to commands 3) Perform the test 4) Forcibly kill the child processes

Without ncover running the tests run reliably and without problems.

With ncover running with only a subset of child process attached to NCover.Console crashes about once every 20 tests. Sometimes right away ... sometimes it runs for an hour before the first problem.

With ncover running with "Cover All" (child process), NCover.Console crashes about once every 10 tests.

With ncover running without attaching to children at all the tests run reliably and without problems.

If I run while attached to child processes and just run a few tests then everything works - so it's not a general compat problem but a random/intermittent issue.

The child processes are all managed 64-bit assemblies running on Windows 7 x64 or Windows 2008 x64.

The exception details when the crash occurs is:

Unhandled Exception: NCover.Framework.Exceptions.ProfilerRuntimeException: NCover encountered an error while trying to read the coverage data from the covered process. This error most commonly happens when NCover.Console is a 64-bit process and the process it was covering was a 32-bit process. For example, MSTest is a 32-bit process even on 64-bit machines. If the covered process is a 32-bit application, then use the 32-bit version of NCover located in "C:\Program Files (x86)\NCover\" to gather coverage data from it. ---> System.Runtime.InteropServices.SEHException: External component has thrown an exception. at NCover.Framework.Helpers.GetNCoverDataInstance(Int32 pid) at NCover.Framework.ProfilerDriver.ProcessMonitorThreadProc(Object param) --- End of inner exception stack trace --- at NCover.Framework.ProfilerDriver.ProcessMonitorThreadProc(Object param) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart(Object obj)

Please note that I'm not using 32 bit processes on a 64 bit machine - these are 100% 64 bit processes.

I speculate that NCover.Console is not handling the fact that the child processes are being forcibly killed (the crash always seems to happen right around this time) rather than shutting down on their own. Since it works 90% of the time, I assume there is a timing issue involved.

If I attach a debugger to NCover.Console the crashing is far less frequent (1 in 100 tests, roughly). I suspect the debugger being attached causes some operations to slow down and reduces the likelihood of the race condition being hit.

Know issue? Suggestions?

Thanks,

Robert.


RE: Frequent crashes (every few minutes)

Hi, Robert. Can you please generate a log file with your coverage run and then send me that file along with your project config to support@ncover.com. I'd like to take a closer look before I make any suggestions.

Thanks!