chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
0 votes
After upgrading from TypeMock 3.0.3 to 3.1.3 we are suddenly facing problems with test cases that die when starting a debug session with the following error:

Unit Test Adapter threw exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

This error only appears when debugging. Running the exact same test case(s) without debug doesn’t trigger the error.

I have tried a lot of different setups, but I can’t seem to nail the exact reason why this appears, but here are my observations. In other words: I can’t reproduce the problem in a small standalone project but I have been able to reproduce it for several of our projects.

The problem seems to be related to the combination of mocking and code coverage. We use VS2005 Team Suite (version 8.0.50727.42) and we have successfully used mocking with the built-in code coverage tools in VS2005 with TypeMock 3.0.3.

So far we have only used the free edition of TypeMock – i.e. we have not used the demo key for the Enterprise Edition. I have subsequently entered the key, but it doesn’t make the issue go away. However, if I reinstall TypeMock 3.0.3 instead of 3.1.3 the problem goes away.
The key in question was received when I registered 3.0.x of TypeMock. VS code coverage does not appear in the Profile/Code Coverage drop-down in the TypeMock configuration tool, so I select “none” from the list.

The issue only appears when one or more projects in a solution use mocking and it only occurs for projects in the same solution that doesn’t use mocking. I can make the problem go away if I initialize TypeMock in the project where the problem occurs.

Code coverage must be enabled to trigger the exception. However, once triggered the bug will keep reappearing even when the test run configuration is changed to not instrument any assemblies.

Any suggestions for solving or collecting more information about the problem will be greatly appreciated.
asked by brian.rasmussen (7.2k points)

2 Answers

0 votes
Thanks for the detailed report. We will try to replicate the bug :twisted:
answered by scott (32k points)
0 votes
This was taken offline and fixed.
The fix will be incorporated in the next patch release
answered by scott (32k points)