Note that there are some explanatory texts on larger screens.

plurals
  1. POInfinite loop in custom VirtualPathProvider causing IIS Crashes
    primarykey
    data
    text
    <p>Our IIS is crashing at regular intervals and we have made a crash dump through DebugDiag that we are investigating. </p> <p>The exception code is always e053534f which I believe is a stack overflow so have been looking at the stacktraces to find an infinite loop of some kind. Two different stack traces occur:</p> <pre><code>System.Web.VirtualPath.Create(System.String, System.Web.VirtualPathOptions) System.Web.VirtualPathUtility.ToAppRelative(System.String) Company.AssemblyResourceProvider.IsAppResourcePath(System.String) Company.AssemblyResourceProvider.GetCacheDependency(System.String, System.Collections.IEnumerable, System.DateTime) System.Web.Hosting.VirtualPathProvider.GetCacheDependency(System.String, System.Collections.IEnumerable, System.DateTime) Company.AssemblyResourceProvider.GetCacheDependency(System.String, System.Collections.IEnumerable, System.DateTime) System.Web.Hosting.VirtualPathProvider.GetCacheDependency(System.String, System.Collections.IEnumerable, System.DateTime) </code></pre> <p>And</p> <pre><code>System.Web.Hosting.MapPathBasedVirtualPathProvider.GetFile(System.String) Company.AssemblyResourceProvider.GetFile(System.String) Company.AssemblyResourceProvider.GetFile(System.String) Company.AssemblyResourceProvider.GetFile(System.String) </code></pre> <p>The code for AssemblyResourceProvider can be seen below.</p> <pre><code>public class AssemblyResourceProvider : System.Web.Hosting.VirtualPathProvider { public AssemblyResourceProvider() {} private bool IsAppResourcePath(string virtualPath) { String checkPath = VirtualPathUtility.ToAppRelative(virtualPath); return checkPath.StartsWith("~/App_Resource/", StringComparison.InvariantCultureIgnoreCase); } public override bool FileExists(string virtualPath) { return (IsAppResourcePath(virtualPath) || base.FileExists(virtualPath)); } public override VirtualFile GetFile(string virtualPath) { if (IsAppResourcePath(virtualPath)) return new AssemblyResourceVirtualFile(virtualPath); else return base.GetFile(virtualPath); } public override System.Web.Caching.CacheDependency GetCacheDependency(string virtualPath, System.Collections.IEnumerable virtualPathDependencies, DateTime utcStart) { if (IsAppResourcePath(virtualPath)) return null; else return base.GetCacheDependency(virtualPath, virtualPathDependencies, utcStart); } } </code></pre> <p>I am unable to reproduce the error on any development setup so this is all I have to go on.</p> <p>My own theory is that I should replace the base. with Previous. but looking at the code of VirtualPathProvider from MS that one seems to just wrap calls to Previous anyway. Without being able to reproduce locally I am left with just making that change, push to live and see what happens.</p> <p>I am hoping someone here will be able to explain why the loops are happening.</p> <p><strong>UPDATE 1</strong></p> <p>Had another crash and dump file which recorded a third variant of the stack trace:</p> <pre><code>System.Web.Hosting.MapPathBasedVirtualPathProvider.GetFile(System.String) Company.AssemblyResourceProvider.GetFile(System.String) System.Web.VirtualPathUtility.ToAppRelative(System.String) Company.AssemblyResourceProvider.GetFile(System.String) System.Web.VirtualPathUtility.ToAppRelative(System.String) Company.AssemblyResourceProvider.GetFile(System.String) System.Web.VirtualPathUtility.ToAppRelative(System.String) </code></pre> <p><strong>UPDATE 2</strong></p> <p>Attempting to use Previous. instead of Base. did not resolve anything.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload