Reputation: 73
App is crashing at startup and Application Error in Event Log gives the following info:
Faulting module name: KERNELBASE.dll, version: 6.2.15063.483, time stamp: 0xc3955624
Exception code: 0xe0434f4d
Fault offset: 0x000eb802
Here's the back story
On one of our customer's networks, our app is crashing before it can even open. I've now spent days searching for answers and haven't been able to solve this yet. I started with some basic troubleshooting, and after not finding any smoking gun, but finding that a new user profile solved the issue, I suggested that was a good fix to get back up and running again. Their outsourced IT agreed at first but is having difficulties migrating user data to a new profile and has never been able to finish moving the affected user to a new profile. Now the issue is occurring on another machine on their network and they are pushing back stating that the issue is with our application and we should spend the time to fix it. I agree that if it's in our code we should fix it, but so far it seems it doesn't even get far enough to reach our code. Also, we have not seen this anywhere else except on this one network with the two accounts that are logging into a domain PC with a local account.
Application Info
User Environment Info
Troubleshooting thus far
Used ProcMon to monitor the app while it crashed and the last line before the Process Exits is an Operation QueryNameInformationFile to C:\Windows\System32\ntdll.dll with a result of SUCCESS. I have ProcMon logs from running normally (with the crash) and running Elevated (without the crash). I've tried to compare but there are thousands of entries and nothing really stands out as the cause.
Researched and used some debugging tools to collect more data including ProcMon, ProcDump and WinDbg. So far the only thing I've found here is the same kernelbase.dll exception info, but only codes are provided, no meaningful message. I had issues loading the symbols, but I think I figured that out. I'm new to WinDbg so I may not have it dialed in 100%. I couldn't get it to successfully load the CLR using .loadby sos clr. I had to use this work around to load SOS, using .load C:\Windows\Microsoft.NET\Framework64\v4.0.30319\SOS.dll and even tried c:\windows\Microsoft.NET\Framework\v4.0.30319\clr.dll, but am still only getting coded exception info and no message in plain english. Here is what I get when using .excr in WinDbg after loading the dump file made using ProcDump
eax=01fcf898 ebx=e0434f4d ecx=00000001 edx=00000000 esi=01fcf928 edi=022da1e0
eip=7453b802 esp=01fcf898 ebp=01fcf8f0 iopl=0 nv up ei pl nz ac po nc
cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00000212
KERNELBASE!RaiseException+0x62:
7453b802 8b4c2454 mov ecx,dword ptr [esp+54h] ss:002b:01fcf8ec=0911506f
I tried using !clrstk in WinDbg but it says "No export clrstk found"
Questions
To me it seems there is an unhandled CLR exception occurring prior to the app startup, probably because of some windows permissions conflicts either on a file or registry entry, but I don't know how to chase it any further.
Upvotes: 4
Views: 5124
Reputation: 729
In my case, the exception code led me to Exception code: 0xe0434f4d
As mentioned in the post, the trick was about .net framework version installed and supportedRuntime key in app.config.
Upvotes: 0
Reputation: 73
I was able to fix this so the app started working again. After comparing two ProcMon logs side-by-side (one from the profile that was crashing, and one from a new profile with same rights) I found that on the profile that was crashing, it started very early referencing apphelp.dll and looking at AppCompatFlags keys in the registry. That led me to believe it was trying to run in compatibility mode, which it shouldn't need to do.
Even though the I made sure there was no compatibility mode set through the UI by right-clicking the app icon and viewing the properties, there were still some records stored in the registry. I removed entries for the app from the following keys and logged the user out and back in, and the issue has gone away. To be fair, I did a few other things as well that may have contributed. I downloaded and ran the .NET Repair Tool. It didn't solve the issue immediately after running it, but I thought I'd mention it just in case it played a part. I ran the repair kit first, then found and removed the registry entries, then logged the user out and back in.
Ultimately, I'm not really sure what caused this to occur in the first place, but from what I read, it's possible the app crashed once, and Windows tried to do some compatibility troubleshooting on it and stored some keys in the registry which ended up causing to crash consistently.
HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Compatibility Assistant\Persisted
Upvotes: 2