Starting with the April 2018 security rollup patch, there is a hard crash of the IIS worker process when using JavascriptEngineSwitcher.Msie and BundleTransformer.Less. This crash is observed on Windows Server 2012 Standard. It is unknown at the moment whether the crash occurs on later versions of Windows Server.
It's unknown whether this issue originates in JavascriptEngineSwitcher.Msie (unlikely), or in MsieJavascriptEngine (more likely). It's also unknown whether this issue is .less specific, or if it may be observed with other file types as well. I'm adding it here because a simple repro case does not require a direct dependency to MsieJavascriptEngine.
A simple repro project is attached.
Requests to any .less file via the LessAssetHandler cause the IIS worker process to crash with the following events written to the Windows Event log:
Log Name: Application
Source: .NET Runtime
Date: 4/24/2018 12:26:36 PM
Event ID: 1026
Task Category: None
Level: Error
Keywords: Classic
User: N/A
Description:
Application: w3wp.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
Stack:
at MsieJavaScriptEngine.ActiveScript.IActiveScriptParse64.ParseScriptText(System.String, System.String, System.Object, System.String, UIntPtr, UInt32, MsieJavaScriptEngine.ActiveScript.ScriptTextFlags, System.Object ByRef, System.Runtime.InteropServices.ComTypes.EXCEPINFO ByRef)
at MsieJavaScriptEngine.ActiveScript.IActiveScriptParse64.ParseScriptText(System.String, System.String, System.Object, System.String, UIntPtr, UInt32, MsieJavaScriptEngine.ActiveScript.ScriptTextFlags, System.Object ByRef, System.Runtime.InteropServices.ComTypes.EXCEPINFO ByRef)
at MsieJavaScriptEngine.ActiveScript.ActiveScriptWrapper64.ParseScriptText(System.String, System.String, System.Object, System.String, UIntPtr, UInt32, MsieJavaScriptEngine.ActiveScript.ScriptTextFlags)
at MsieJavaScriptEngine.ActiveScript.ActiveScriptJsEngineBase.InnerExecute(System.String, System.String, Boolean)
at MsieJavaScriptEngine.ActiveScript.ActiveScriptJsEngineBase+<>c__DisplayClass34_0.<Evaluate>b__0()
at MsieJavaScriptEngine.ScriptDispatcher+<>c__DisplayClass12_0`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].<Invoke>b__0()
at MsieJavaScriptEngine.ScriptDispatcher.StartThread()
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.ThreadHelper.ThreadStart()
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name=".NET Runtime" />
<EventID Qualifiers="0">1026</EventID>
<Level>2</Level>
<Task>0</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2018-04-24T16:26:36.000000000Z" />
<EventRecordID>19019</EventRecordID>
<Channel>Application</Channel>
<Security />
</System>
<EventData>
<Data>Application: w3wp.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
Stack:
at MsieJavaScriptEngine.ActiveScript.IActiveScriptParse64.ParseScriptText(System.String, System.String, System.Object, System.String, UIntPtr, UInt32, MsieJavaScriptEngine.ActiveScript.ScriptTextFlags, System.Object ByRef, System.Runtime.InteropServices.ComTypes.EXCEPINFO ByRef)
at MsieJavaScriptEngine.ActiveScript.IActiveScriptParse64.ParseScriptText(System.String, System.String, System.Object, System.String, UIntPtr, UInt32, MsieJavaScriptEngine.ActiveScript.ScriptTextFlags, System.Object ByRef, System.Runtime.InteropServices.ComTypes.EXCEPINFO ByRef)
at MsieJavaScriptEngine.ActiveScript.ActiveScriptWrapper64.ParseScriptText(System.String, System.String, System.Object, System.String, UIntPtr, UInt32, MsieJavaScriptEngine.ActiveScript.ScriptTextFlags)
at MsieJavaScriptEngine.ActiveScript.ActiveScriptJsEngineBase.InnerExecute(System.String, System.String, Boolean)
at MsieJavaScriptEngine.ActiveScript.ActiveScriptJsEngineBase+<>c__DisplayClass34_0.<Evaluate>b__0()
at MsieJavaScriptEngine.ScriptDispatcher+<>c__DisplayClass12_0`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].<Invoke>b__0()
at MsieJavaScriptEngine.ScriptDispatcher.StartThread()
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.ThreadHelper.ThreadStart()
</Data>
</EventData>
</Event>