1

I have an application that is running absolutely fine on local computers, using a variety of environments (SQL, Windows). However, we have one particular environment where it fails to run, throwing up a c0000005 error in clr.dll.

Are there any techniques that I can use to identify what is going on in this particular (somewhat restricted) environment? The C# code is not hit, so there is something in the initial load and setup of the app that is failing.

I don't expect an answer to why it is failing, but some help on how I can find anything more than the very limited crash report. The code is using .net 4.6.2, so there should be very little (if any) direct interaction with the windows tools themselves. I suspect it is either a corrupt dll on the server or the app is trying to load something that is missing in this environment. Or, possibly, it is seeking to access something that it is not allowed to (it is only a problem across two servers).

Schroedingers Cat
  • 3,099
  • 1
  • 15
  • 33
  • What is the `particular environment` ? any specific OS and SQL version? You have application logs which has some information about error? You can look in to eventlogs of the machine to see what could have gone wrong when you run the application there. – Chetan Feb 22 '17 at 16:32
  • aren't errors of that number pattern(ending in 5) usually Access related errors? Sorry can't help on your actual question. – blaze_125 Feb 22 '17 at 16:33
  • Windows server 2008R2. There is nothing helpful on the event logs - it tells me that the clr.dll is failing with c0000005, but I cannot get any more insight into why it fails in this particualar situation. – Schroedingers Cat Feb 22 '17 at 16:35
  • @SchroedingersCat it happened also to me a similar issue. I'd first look what version of .NET is installed on the machine and what CLR version is using. – peval27 Feb 22 '17 at 16:40
  • Yes I checked the .net versions ( and the clr.dll file versions).What did you do to resolve it? – Schroedingers Cat Feb 22 '17 at 16:41
  • If you have the liberty to reload the application on the server, I'd write a log where your process breaks. Log all the stuff you're connecting to, or trying to use. Once you know the paths you're trying to use, check if the server has access to them all. – blaze_125 Feb 22 '17 at 16:44
  • @SchroedingersCat In my case there was installed a CLR 4.0 but older than the 4.0 used to build the application. We were targeting .NET 4.0, and .NET 4.5 was an in place upgrade for 4.0. If on that machine there is an older version, then updating it might solve the problem – peval27 Feb 22 '17 at 16:44
  • @SchroedingersCat another way is to attach a debugger. Is it feasible? – peval27 Feb 22 '17 at 16:45
  • @peval27, I think the debugger is a great idea. Led me to [this Microsoft page: Attach to Running Processes with the Visual Studio Debugger](https://msdn.microsoft.com/en-us/library/3s68z0b3.aspx) – blaze_125 Feb 22 '17 at 16:50
  • OK, I will look at the .net versions. It definately has the right one, but it probably also has wrong ones. A debugger is complex. Particularly because it is failing before it gets into my code. I added something in the Application_Startup, and it never made it that far. – Schroedingers Cat Feb 22 '17 at 16:54
  • You can check for failures to load assemblies with https://msdn.microsoft.com/en-us/library/e74a18c4(v=vs.110).aspx – Crowcoder Feb 22 '17 at 17:42
  • Contact Microsoft support and open a support case via http://support.microsoft.com if you are not familiar with tools such as WinDbg. It would be pretty easy to grab a crash dump for that c0000005 crash and then analyze the root cause from it, but definitely not everyone is capable of doing so. – Lex Li Feb 22 '17 at 17:44
  • You don't have a stack trace along with that Access Violation error code? That code means you tried to access a virtual memory address that has not been mapped into your process... – hoodaticus Feb 22 '17 at 18:23
  • This link may be relevant: http://stackoverflow.com/questions/5187898/net-4-0-windows-application-crashes-in-clr-dll-under-windows-server-2008 Something else that's worked for people is to uninstall all versions of the .NET framework and then re-install just the versions you need. – sheppe Feb 22 '17 at 18:31
  • After a lot of searching, I found that it is throwing an "mscorlib recursive resource lookup bug". Which is helpful, but I still cannot find where this is getting thrown from. – Schroedingers Cat Feb 24 '17 at 16:23

1 Answers1

0

Windows 2008 is already creating a mini dump for you. Read here: https://msdn.microsoft.com/en-us/library/windows/desktop/ee416349(v=vs.85).aspx#writing_a_minidump

Find the minidump and open it in Visual Studio, dmpcheck, or another tool. Somewhere there should be something that says SEH or Access Violation in one of the stack traces. That will tell you the offending method or function.

hoodaticus
  • 3,772
  • 1
  • 18
  • 28