I have a website that i've been working on for about a year now. Recently, it's started throwing System.AccessViolationException every now and then, in my dev machine, mostly, when I was away from the machine...
I haven't changed anything on the server code in weeks, since I've been working 100% on the Javascript part, and this error started appearing recently.
Also, the code I'm doing is 100% managed. I'm not doing any interop, calling strange DLLs, nothing. It's pure VB.Net, so I don't see how I could be generating one of these myself...
Now, I've been using this new machine for a couple of months, and it's not working 100% right. Every 2 or 3 days I'm getting a blue screen for example. I haven't had time to diagnose it properly, but I'm suspecting I may have a faulty RAM chip.
Is it possible that faulty RAM could lead to an AccessViolationException?
Or do I have an actual problem I should be looking into? (besides my RAM)
UPDATE:
I'm not really being able to find WHERE the error occurs, really.
I get the "unhandled exception, do you want to debug?" dialog, and when I attach the debugger, I have the Threads list, where I have all the ASP.Net threads, and 3 I create myself.
For these 3 I have a Call Stack , and they're all stopped at a Sleep() call (which is expectable).
For all the other threads, including the one that VS points to as the problem one, I have no Call Stack. I also have no details about the exception whatsoever.
So I don't know whether it happens every time in the same place or not.
As for memtest, yes, I'm going to do something like that, I'm just hoping to have SOME time to do it soon, but I wanted to know, in the meantime, whether this could explain this problem.
UPDATE 2:
Found this in the event log...
An unhandled exception occurred and the process was terminated.
Application ID: DefaultDomain
Process ID: 6632
Exception: System.AccessViolationException
Message: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
StackTrace: at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
Any ideas what to make of this?
Thanks
Daniel