damianh / LibLog

LibLog is a single file for you to either copy/paste or install via nuget, into your library/framework/application to provide a logging abstraction.
MIT License
929 stars 153 forks source link

4.2.5. and 4.2.6 seems to have an issue with Enterprise.Library.Logging log provider: StackoverflowException occurs at AppPool idle time shutdown #248

Closed netsrotr closed 5 years ago

netsrotr commented 5 years ago

I invested yet two days searching around and try to track down this StackoverFlowException.

We use a MVC Web App Wrapper to serve an Angular 7 SPA with .NET 4.6, and a separate WebAPI 2 project modelling the backend for Anglular REST data calls. We base on Owin 4.0 to use auth. middleware, etc. and among others we used LibLog 4.2.6 (newer is not supported with that environment).

I commented out a lot of things I thought it was the source of the exception (no callstack, no useful info in Windows Eventlogs). At last I commented out this line of code:

app.SetLoggerFactory(new LibLogLoggerFactory()); EDIT: LibLogLoggerFactory is the code generated by the liblog NuGet package.

And the stackoverflowexception went away!

I reverted LibLog to v4.2.5 (version the IdentityServer v3 uses and I thought it should be stable), but same problem: Idle timeout of the AppPool happens and just shutdown the w3wp.exe process too. Faulting application name: w3wp.exe, version: 8.5.9600.16384, time stamp: 0x5215df96 Faulting module name: ntdll.dll, version: 6.3.9600.19304, time stamp: 0x5c7f684f Exception code: 0xc0000008 Fault offset: 0x000000000009269a Faulting process id: 0x3260 Faulting application start time: 0x01d5236c2bf3bc6d Faulting application path: c:\windows\system32\inetsrv\w3wp.exe Faulting module path: C:\Windows\SYSTEM32\ntdll.dll Report Id: a688d86c-8f60-11e9-8490-a088696de88f Faulting package full name: Faulting package-relative application ID:

damianh commented 5 years ago

Hi @netsrotr, sorry to hear you are having problems. This is the first time I've heard of a problem of this type in the several years this project has been around. I literally have no idea how to reproduce this; it could be any multitude of things to be honest.

I'm focusing my support on the 5.x line (which doesn't support EntLib logging as it is obsolete). However if you could supply a minimal project that clearly reproduces the issue as a github repository that I can clone, then I can take a look.

netsrotr commented 5 years ago

Yes, I know it is obsolete old techn., we still have to use/support. You can close the issue, I was happy way too early as the problem continue and still exists, it is not repro. 100%, that opened case was just the 1% it did not occured (for any other reason). But thanks for your response and sorry about that. Profiling now and hope I can get some ideas that way by catching the last possibly recursive call(s) causing that SOE...

damianh commented 5 years ago

Thanks for getting back to me so quickly. I understand that you have to support and I understand there are may libs using LibLog thus am happy to look at 4.x issues critical issues. If it turns out to be LibLog, please re-open (with a repro) and I'l take a look.