It looks like you have a StackOverflow Exception, which is caused by unbounded recursion (a function repeatedly calling itself, etc). This can’t be caught by regular try/catch block. You can track the problem down using DebugDiag and WinDbg.
DebugDiag can be configured to generate a crash dump when the StackOverflowException occurs. Download at https://www.microsoft.com/en-us/download/details.aspx?id=58210.
- Open DebugDiag and click Add Rule.
- “Crash” should already be selected. Click Next.
- Choose “A specific IIS web application pool” and click Next.
- Select the application pool and click Next.
- You should be on the Advanced Configuration Window. Click Exceptions under Advanced Settings.
- Click Add Exception and choose Stack Overflow, with an Action Type of Full Userdump
- Click OK and save and close out.
Next time a StackOverflowException occurs, you’ll have a crash dump. Now to need to interpret the dump file.
Debugging tools for Windows is part of the Windows SDK and can be downloaded at http://msdn.microsoft.com/en-US/windows/hardware/gg463009/.
- To use WinDbg, you’ll need to get the symbols files. Download the symbol files and put them in a local folder.
- Open up WinDbg. On the File menu, click Symbol File Path.
- In the Symbol path box, the documentation says to type the following command:
SRV*your local folder for symbols*http://msdl.microsoft.com/download/symbols
, however I just put in the local folder for the symbols and it worked fine. - Exit out and open WinDbg again, and Open Crash Dump and locate the dump file that was created by DebugDiag.
- In the command line, type
.loadby sos clr
- Now type
!CLRStack
In the results, it should be clear what the problem is (you’ll likely see a BUNCH of lines showing the function(s) that was repeatedly being called).