-
Notifications
You must be signed in to change notification settings - Fork 248
Random access violations with VS2015 compiler and OpenCover 4.6.166 / 4.5.3723 #329
Comments
looks like it is related to this pull request #330 - do you have a code sample so I can investigate the latter issue further? |
Unfortunately I can provide a sample to reproduce because the crashes occur more or less randomly. I've built the fix version from #330 myself and will run it in my environment to see if this fixes the crashes... |
urasandesu@d1f07d4 does not fix my problem, still access violations. I can offer to run an instrumented build on my environment which collects hopefully helpful informations about the problem... |
@Sam13 - thanks for the offer but I tend to tweak the instrumentation based on the issue - otherwise it's too hard to wade through all the data - hence why a reproducible sample is much easier |
@sawilde Did you try to run the OpenCover over something compiled with VS2015? I tried again to find some repeatable behavior but without success. I tried to isolate a failing test assembly (normally run OpenCover over nunit-console with 33 different assemblies). When I run only over an assembly that might have caused the crash it did not crash anymore... The only thing I got might not be very helpful
Since I'm not very familiar with unmanaged code can you give me some advice how to lookup for something that might help you? |
Same issue here:
I'm using VS 2015 / Microsoft Build Tools 2015 and nunit. The problem appears randomly. |
Version 15c47b8 still crashes Application: nunit-agent-x86.exe |
It seems odd that this is happening in A repeatable example would be really useful right now. |
I set the filter like that:
I totally agree a sample would be nice, but I can't provide one. |
Unfortunately I don't have an repeatable example. The exception occurs randomly at different tests. Sometimes the error appears 1-2 times a day. Sometimes it takes a few days until it happens again. |
@Sam13 - It's not something I have seen myself so I don't know if it is OpenCover causing NUnit to crash or NUnit just crashing; especially in the case of the crash in @bunnu - Have you tried the latest build? https://ci.appveyor.com/project/sawilde/opencover/build/4.6.177/artifacts |
@sawilde Now I'll try the latest build. Yesterday I run a self compiled debug build of 15c47b8 and there a debug assertion was shown of OpenCover.Profiler.dll. I had no luck debugging it. Will try again if latest version still fails... |
@Sam13 - I am not sure what to do next - I can't fix something if I can't repeat it as i don't know if I am fixing the right thing. If you can supply a repeatable sample that would be great owever I don't know what your code does so I don't know if this is feasible. |
@sawilde As already state earlier, the debug build of 15c47b8 produces sometimes an assertion when running over my tests. It seems that something with Let me know if you need more informations? I can also run an instrumented build... |
hmm it might be a race condition that I was not expecting... |
#329 add critical section block around use of m_visitmap during Shutdown (can we get a ThreadDestroyed during Shutdown?)
Still access violation with OC 4.6.183.
|
Thanks that is awesome - it seems to be having an issue processing the results from the host What I suspect is that the host is not populating the array before returning to the client - unusual. I've added extra diagnostics around this area. NOTE: can you provide extra details on how you used WinDbg in this scenario; perhaps I can build a special diagnostics package and instructions that I can provide to people with similar issues. |
You probably see the extra messages if you use DebugView (part of sysinternals) |
I'm already using DebugView and also did http://stackoverflow.com/questions/12494300/no-output-from-debugview/12800603#12800603 but still not messages from OpenCover when access violation happens. I'm using binaries of version 4.6.184 from app veyor. |
None at all? That is odd as even release build pumps out a few messages especially during profiler start/stop. |
Now I do get it, I've created a pull request which writes all output to the debug output with a prefix: #341. It seems not much of your added tracing is printed when the exception happens (see end of trace): Here is the debug output of the whole coverage process when the access violation happens:
|
Okay that looks odd it seems the OpenCover is tracking the I also note that one of the buffer allocations failed due to a timeout > 10s; the SendVisitPoints at th end are also failing due to timeouts but is probably due to the fact that opencover has started shutting down. How are you running nunit to launch so many agents? |
We have very recent changes thanks to Coverity. @Sam13 |
@ddur Thanks, I tried but build 365 doesn't seem to work either. Same output in DebugView.
Basically I exclude everything and include the production assemblies with
this always worked so far... |
@Sam13 BTW,
|
it seems to be the |
@sawilde |
Filtering now works, but nunit-agent occasionally crashes. |
damn! |
Never had any similar problems with OpenCover. BTW, I experienced collision crash while accessing same assembly while running number of "doogfood-release" tests in parallel. |
I'm planning to migrate to .NET 4.6.1 and NUnit 3 soon. Once done I'll try to reenable OpenCover coverage, maybe this fixes the occasional crashes as well... |
We have published the release at https://www.nuget.org/packages/OpenCover/4.6.519 and https://github.com/OpenCover/opencover/releases/tag/4.6.519 |
In meantime I migrated to .NET 4.6.1 and NUnit 3. I was only able to do a few tests with 4.6.515-rc. That's why I did not report anything so far. |
:) - let us know how you progress - we'll check back in a week or so. |
I assume you are still running them in parallel? If you run DebugView then you might see what OpenCover is up to during this time - it does wait for the host process to shutdown so you could use the process exclusion to not not instrument the nunit console app; you will need to hook into the agents though). That way we can determine if the profiler itself is causing issues. |
Yes I'm using the parallelization algorithms inside NUnit3, that is supported, isn't it? Ok I'll try and get back as soon as I have some results... |
As much as it can be, but you may not get the performance benefits of parallelization due to internal locks within the profiler. |
Ok, I'll also do some tests with disabled parallelization... |
We also added a |
Finally, I found some time to play around with version 4.6.519. |
the default is Thanks for persevering - if we ever meet I owe you a beer or two - 🍻 Are we good to close? |
Yes I think so, no crashes so far... Can be closed from my side. Thanks for your support. |
I upgraded recently from VS2010 .NET 4.0 / OpenCover 4.5.3522 to
VS2015 .NET 4.0 (uses .NET 4.5 compiler to generate .NET 4.0) / OpenCover 4.5.3723 / 4.6.166
When running my unit tests compiled with VS2010 and OpenCover 4.5.3522 they work fine.
When running my unit tests compiled with VS2015 without OpenCover they work fine.
When running with OC 4.6.166 or 4.5.3723 they crash randomly.
I cannot use a version < 4.5.3723 because of #319 .
Mostly there is an AccessVioloationException
or sometimes an ArgumentOutOfRangeException:
The text was updated successfully, but these errors were encountered: