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

Notification

Icon
Error

AccessViolationException on creation of application domain
springjazzy
#1 Posted : Monday, January 30, 2017 8:38:56 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 6/6/2012(UTC)
Posts: 46

Could you please verify that this simple test crashes NCrunch:

Code:

using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace UnitTestProject1
{
    [TestClass]
    public class UnitTest1
    {
        [TestMethod]
        public void TestMethod1()
        {
            var _appDomain = AppDomain.CreateDomain(string.Format("App_{0}", Guid.NewGuid()));
        }
    }
}


If I choose to build test project as 4.0 .NET Framework then everything works fine, but when I choose 4.5.2. .NET Framework then NCrunch keeps showing System.AccessViolationException. BTW MSTest runs this test without any problem.

I use latest NCrunch 3.3.0.6 with VS2013
springjazzy
#2 Posted : Monday, January 30, 2017 9:21:07 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 6/6/2012(UTC)
Posts: 46

Got it. That's because third party cryptographic library. Interestingly though, that I've marked method with HandleProcessCorruptedStateExceptionsAttribute and SecurityCriticalAttribute and still couldn't intercept it, which points that exception is thrown somewhere in NCrunch.
Remco
#3 Posted : Monday, January 30, 2017 10:11:18 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 960 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi, thanks for sharing this issue.

This code seems to run normally for me regardless of the target framework.

Do you have FIPS enabled on your system?

Does turning off the 'Instrument output assembly' setting for the projects involved make any difference?
springjazzy
#4 Posted : Monday, January 30, 2017 10:23:13 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 6/6/2012(UTC)
Posts: 46

>Do you have FIPS enabled on your system?
No. I use other crypto algorithms


>Does turning off the 'Instrument output assembly' setting for the projects involved make any difference?
No. No difference.

Remco
#5 Posted : Tuesday, January 31, 2017 10:37:23 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 960 times
Was thanked: 1290 time(s) in 1196 post(s)
Do you experience this problem if you execute the same code under NUnit, using the NUnit console runner?

This looks to be a system related issue.
springjazzy
#6 Posted : Wednesday, February 1, 2017 7:13:18 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 6/6/2012(UTC)
Posts: 46

Don't know about NUnit. But if I run tests under Resharper test system (which suspiciously looks like NCrunch by the way) I also get AccessViolationException. The only way to pass test is run it under native MSTest VS runner.

I agree. It looks like issue related to that third party crypto library.
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.031 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download