Are you the publisher? Claim or contact us about this channel


Embed this content in your HTML

Search

Report adult content:

click to rate:

Account: (login)

More Channels


Channel Catalog


Channel Description:

ClearScript is a library that makes it easy to add scripting to your .NET applications. It currently supports JavaScript (via V8 and JScript) and VBScript.
    0 0

    I am trying to run my application in a docker container, but it crashes with the following error:

    ```
    Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
    at std._Func_class<void>.()(_Func_class<void>* )
    at Microsoft.ClearScript.V8.NativeCallbackImpl.Invoke()
    at Microsoft.ClearScript.Util.MiscHelpers.Try(Action action)
    at Microsoft.ClearScript.Util.NativeCallbackTimer.OnTimer(Object state)
    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    at System.Threading.TimerQueueTimer.CallCallback()
    at System.Threading.TimerQueueTimer.Fire()
    at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
    at System.Threading.ThreadPoolWorkQueue.Dispatch()
    ```

    There are a lot of script code in the application, so it is difficult to find the specific lines of code that causes the crash. Does anyone have any ideas what could cause that or advice how to debug this issue?

    0 0

    I am trying to run my application in a docker container, but it crashes with the following error:

    ```
    Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
    at std._Func_class<void>.()(_Func_class<void>* )
    at Microsoft.ClearScript.V8.NativeCallbackImpl.Invoke()
    at Microsoft.ClearScript.Util.MiscHelpers.Try(Action action)
    at Microsoft.ClearScript.Util.NativeCallbackTimer.OnTimer(Object state)
    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    at System.Threading.TimerQueueTimer.CallCallback()
    at System.Threading.TimerQueueTimer.Fire()
    at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
    at System.Threading.ThreadPoolWorkQueue.Dispatch()
    ```

    another exception

    ```
    Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
    at V8Context.Create(SharedPtr<V8Isolate>* , StdString* , Boolean , Boolean , Int32 )
    at Microsoft.ClearScript.V8.V8ContextProxyImpl..ctor(V8IsolateProxy gcIsolateProxy, String gcName, Boolean enableDebugging, Boolean disableGlobalMembers, Int32 debugPort)
    --- End of inner exception stack trace ---
    at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
    at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
    at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
    at System.Activator.CreateInstance(Type type, Object[] args)
    at Microsoft.ClearScript.V8.V8Proxy.CreateImpl[T](Object[] args)
    at Microsoft.ClearScript.V8.V8ScriptEngine..ctor(V8Runtime runtime, String name, V8RuntimeConstraints constraints, V8ScriptEngineFlags flags, Int32 debugPort)
    at JavaScriptEngineSwitcher.V8.V8JsEngine..ctor(V8Settings settings)
    at JavaScriptEngineSwitcher.V8.V8JsEngineFactory.CreateEngine()
    at React.JavaScriptEngineFactory.GetFactory(JsEngineSwitcher jsEngineSwitcher, Boolean allowMsie)
    at React.JavaScriptEngineFactory..ctor(JsEngineSwitcher jsEngineSwitcher, IReactSiteConfiguration config, IFileSystem fileSystem)
    at lambda_method(Closure , Object[] )
    at React.TinyIoC.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, NamedParameterOverloads parameters, ResolveOptions options)
    at React.TinyIoC.TinyIoCContainer.SingletonFactory.GetObject(Type requestedType, TinyIoCContainer container, NamedParameterOverloads parameters, ResolveOptions options)
    at React.TinyIoC.TinyIoCContainer.ResolveInternal(TypeRegistration registration, NamedParameterOverloads parameters, ResolveOptions options)
    at React.TinyIoC.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, NamedParameterOverloads parameters, ResolveOptions options)
    at React.TinyIoC.TinyIoCContainer.CustomObjectLifetimeFactory.GetObject(Type requestedType, TinyIoCContainer container, NamedParameterOverloads parameters, ResolveOptions options)
    at React.TinyIoC.TinyIoCContainer.ResolveInternal(TypeRegistration registration, NamedParameterOverloads parameters, ResolveOptions options)
    at React.TinyIoC.TinyIoCContainer.Resolve[ResolveType]()
    at React.AspNet.HtmlHelperExtensions.get_Environment()
    at React.AspNet.HtmlHelperExtensions.React[T](IHtmlHelper htmlHelper, String componentName, T props, String htmlTag, String containerId, Boolean clientOnly, Boolean serverOnly, String containerClass)
    at AspNetCore._Views_Site_Menu_cshtml.<ExecuteAsync>d__33.MoveNext() in /Views/Site/Menu.cshtml:line 3
    at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
    at AspNetCore._Views_Site_Menu_cshtml.ExecuteAsync()
    ```

    There are a lot of script code in the application, so it is difficult to find the specific lines of code that causes the crash. Does anyone have any ideas what could cause that or advice how to debug this issue?

    0 0

    I am trying to run my application in a docker container, but it crashes with the following error:

    ```
    Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
    at std._Func_class<void>.()(_Func_class<void>* )
    at Microsoft.ClearScript.V8.NativeCallbackImpl.Invoke()
    at Microsoft.ClearScript.Util.MiscHelpers.Try(Action action)
    at Microsoft.ClearScript.Util.NativeCallbackTimer.OnTimer(Object state)
    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    at System.Threading.TimerQueueTimer.CallCallback()
    at System.Threading.TimerQueueTimer.Fire()
    at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
    at System.Threading.ThreadPoolWorkQueue.Dispatch()
    ```

    another exception

    ```
    Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
    at V8Context.Create(SharedPtr<V8Isolate>* , StdString* , Boolean , Boolean , Int32 )
    at Microsoft.ClearScript.V8.V8ContextProxyImpl..ctor(V8IsolateProxy gcIsolateProxy, String gcName, Boolean enableDebugging, Boolean disableGlobalMembers, Int32 debugPort)
    --- End of inner exception stack trace ---
    at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
    at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
    at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
    at System.Activator.CreateInstance(Type type, Object[] args)
    at Microsoft.ClearScript.V8.V8Proxy.CreateImpl[T](Object[] args)
    at Microsoft.ClearScript.V8.V8ScriptEngine..ctor(V8Runtime runtime, String name, V8RuntimeConstraints constraints, V8ScriptEngineFlags flags, Int32 debugPort)
    at JavaScriptEngineSwitcher.V8.V8JsEngine..ctor(V8Settings settings)
    at JavaScriptEngineSwitcher.V8.V8JsEngineFactory.CreateEngine()
    at React.JavaScriptEngineFactory.GetFactory(JsEngineSwitcher jsEngineSwitcher, Boolean allowMsie)
    at React.JavaScriptEngineFactory..ctor(JsEngineSwitcher jsEngineSwitcher, IReactSiteConfiguration config, IFileSystem fileSystem)
    at lambda_method(Closure , Object[] )
    at React.TinyIoC.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, NamedParameterOverloads parameters, ResolveOptions options)
    at React.TinyIoC.TinyIoCContainer.SingletonFactory.GetObject(Type requestedType, TinyIoCContainer container, NamedParameterOverloads parameters, ResolveOptions options)
    at React.TinyIoC.TinyIoCContainer.ResolveInternal(TypeRegistration registration, NamedParameterOverloads parameters, ResolveOptions options)
    at React.TinyIoC.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, NamedParameterOverloads parameters, ResolveOptions options)
    at React.TinyIoC.TinyIoCContainer.CustomObjectLifetimeFactory.GetObject(Type requestedType, TinyIoCContainer container, NamedParameterOverloads parameters, ResolveOptions options)
    at React.TinyIoC.TinyIoCContainer.ResolveInternal(TypeRegistration registration, NamedParameterOverloads parameters, ResolveOptions options)
    at React.TinyIoC.TinyIoCContainer.Resolve[ResolveType]()
    at React.AspNet.HtmlHelperExtensions.get_Environment()
    at React.AspNet.HtmlHelperExtensions.React[T](IHtmlHelper htmlHelper, String componentName, T props, String htmlTag, String containerId, Boolean clientOnly, Boolean serverOnly, String containerClass)
    at AspNetCore._Views_Site_Menu_cshtml.<ExecuteAsync>d__33.MoveNext() in /Views/Site/Menu.cshtml:line 3
    at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
    at AspNetCore._Views_Site_Menu_cshtml.ExecuteAsync()
    ```

    There are a lot of script code in the application, so it is difficult to find the specific lines of code that causes the crash. Does anyone have any ideas what could cause that or advice how to debug this issue?
    Comments: Hello! These stacks (especially the second one) almost always indicate out-of-memory conditions, which V8 handles by crashing immediately via unrecoverable access violation. Ignoring the possibility of runaway script code, this can happen if you create a large number of V8 runtimes in a 32-bit process. Each V8 runtime reserves a large block of address space at startup, and in a 32-bit process you can run out of address space with just a few dozen instances. Another possibility is that the V8 runtime is too constrained to complete startup. Are you using `V8RuntimeConstraints` to specify memory usage limits? Also, could it be that Docker is imposing various limits on your application? Thanks!

    0 0

    I am trying to run my application in a docker container, but it crashes with the following error:

    ```
    Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
    at std._Func_class<void>.()(_Func_class<void>* )
    at Microsoft.ClearScript.V8.NativeCallbackImpl.Invoke()
    at Microsoft.ClearScript.Util.MiscHelpers.Try(Action action)
    at Microsoft.ClearScript.Util.NativeCallbackTimer.OnTimer(Object state)
    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    at System.Threading.TimerQueueTimer.CallCallback()
    at System.Threading.TimerQueueTimer.Fire()
    at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
    at System.Threading.ThreadPoolWorkQueue.Dispatch()
    ```

    another exception

    ```
    Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
    at V8Context.Create(SharedPtr<V8Isolate>* , StdString* , Boolean , Boolean , Int32 )
    at Microsoft.ClearScript.V8.V8ContextProxyImpl..ctor(V8IsolateProxy gcIsolateProxy, String gcName, Boolean enableDebugging, Boolean disableGlobalMembers, Int32 debugPort)
    --- End of inner exception stack trace ---
    at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
    at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
    at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
    at System.Activator.CreateInstance(Type type, Object[] args)
    at Microsoft.ClearScript.V8.V8Proxy.CreateImpl[T](Object[] args)
    at Microsoft.ClearScript.V8.V8ScriptEngine..ctor(V8Runtime runtime, String name, V8RuntimeConstraints constraints, V8ScriptEngineFlags flags, Int32 debugPort)
    at JavaScriptEngineSwitcher.V8.V8JsEngine..ctor(V8Settings settings)
    at JavaScriptEngineSwitcher.V8.V8JsEngineFactory.CreateEngine()
    at React.JavaScriptEngineFactory.GetFactory(JsEngineSwitcher jsEngineSwitcher, Boolean allowMsie)
    at React.JavaScriptEngineFactory..ctor(JsEngineSwitcher jsEngineSwitcher, IReactSiteConfiguration config, IFileSystem fileSystem)
    at lambda_method(Closure , Object[] )
    at React.TinyIoC.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, NamedParameterOverloads parameters, ResolveOptions options)
    at React.TinyIoC.TinyIoCContainer.SingletonFactory.GetObject(Type requestedType, TinyIoCContainer container, NamedParameterOverloads parameters, ResolveOptions options)
    at React.TinyIoC.TinyIoCContainer.ResolveInternal(TypeRegistration registration, NamedParameterOverloads parameters, ResolveOptions options)
    at React.TinyIoC.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, NamedParameterOverloads parameters, ResolveOptions options)
    at React.TinyIoC.TinyIoCContainer.CustomObjectLifetimeFactory.GetObject(Type requestedType, TinyIoCContainer container, NamedParameterOverloads parameters, ResolveOptions options)
    at React.TinyIoC.TinyIoCContainer.ResolveInternal(TypeRegistration registration, NamedParameterOverloads parameters, ResolveOptions options)
    at React.TinyIoC.TinyIoCContainer.Resolve[ResolveType]()
    at React.AspNet.HtmlHelperExtensions.get_Environment()
    at React.AspNet.HtmlHelperExtensions.React[T](IHtmlHelper htmlHelper, String componentName, T props, String htmlTag, String containerId, Boolean clientOnly, Boolean serverOnly, String containerClass)
    at AspNetCore._Views_Site_Menu_cshtml.<ExecuteAsync>d__33.MoveNext() in /Views/Site/Menu.cshtml:line 3
    at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
    at AspNetCore._Views_Site_Menu_cshtml.ExecuteAsync()
    ```

    There are a lot of script code in the application, so it is difficult to find the specific lines of code that causes the crash. Does anyone have any ideas what could cause that or advice how to debug this issue?
    Comments: Thanks! You are right, it was a memory limit issue. I think Docker has some default memory constraint for the container. After I specified 2GB memory for the container the application runs fine.

    0 0

    I am trying to run my application in a docker container, but it crashes with the following error:

    ```
    Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
    at std._Func_class<void>.()(_Func_class<void>* )
    at Microsoft.ClearScript.V8.NativeCallbackImpl.Invoke()
    at Microsoft.ClearScript.Util.MiscHelpers.Try(Action action)
    at Microsoft.ClearScript.Util.NativeCallbackTimer.OnTimer(Object state)
    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    at System.Threading.TimerQueueTimer.CallCallback()
    at System.Threading.TimerQueueTimer.Fire()
    at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
    at System.Threading.ThreadPoolWorkQueue.Dispatch()
    ```

    another exception

    ```
    Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
    at V8Context.Create(SharedPtr<V8Isolate>* , StdString* , Boolean , Boolean , Int32 )
    at Microsoft.ClearScript.V8.V8ContextProxyImpl..ctor(V8IsolateProxy gcIsolateProxy, String gcName, Boolean enableDebugging, Boolean disableGlobalMembers, Int32 debugPort)
    --- End of inner exception stack trace ---
    at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
    at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
    at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
    at System.Activator.CreateInstance(Type type, Object[] args)
    at Microsoft.ClearScript.V8.V8Proxy.CreateImpl[T](Object[] args)
    at Microsoft.ClearScript.V8.V8ScriptEngine..ctor(V8Runtime runtime, String name, V8RuntimeConstraints constraints, V8ScriptEngineFlags flags, Int32 debugPort)
    at JavaScriptEngineSwitcher.V8.V8JsEngine..ctor(V8Settings settings)
    at JavaScriptEngineSwitcher.V8.V8JsEngineFactory.CreateEngine()
    at React.JavaScriptEngineFactory.GetFactory(JsEngineSwitcher jsEngineSwitcher, Boolean allowMsie)
    at React.JavaScriptEngineFactory..ctor(JsEngineSwitcher jsEngineSwitcher, IReactSiteConfiguration config, IFileSystem fileSystem)
    at lambda_method(Closure , Object[] )
    at React.TinyIoC.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, NamedParameterOverloads parameters, ResolveOptions options)
    at React.TinyIoC.TinyIoCContainer.SingletonFactory.GetObject(Type requestedType, TinyIoCContainer container, NamedParameterOverloads parameters, ResolveOptions options)
    at React.TinyIoC.TinyIoCContainer.ResolveInternal(TypeRegistration registration, NamedParameterOverloads parameters, ResolveOptions options)
    at React.TinyIoC.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, NamedParameterOverloads parameters, ResolveOptions options)
    at React.TinyIoC.TinyIoCContainer.CustomObjectLifetimeFactory.GetObject(Type requestedType, TinyIoCContainer container, NamedParameterOverloads parameters, ResolveOptions options)
    at React.TinyIoC.TinyIoCContainer.ResolveInternal(TypeRegistration registration, NamedParameterOverloads parameters, ResolveOptions options)
    at React.TinyIoC.TinyIoCContainer.Resolve[ResolveType]()
    at React.AspNet.HtmlHelperExtensions.get_Environment()
    at React.AspNet.HtmlHelperExtensions.React[T](IHtmlHelper htmlHelper, String componentName, T props, String htmlTag, String containerId, Boolean clientOnly, Boolean serverOnly, String containerClass)
    at AspNetCore._Views_Site_Menu_cshtml.<ExecuteAsync>d__33.MoveNext() in /Views/Site/Menu.cshtml:line 3
    at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
    at AspNetCore._Views_Site_Menu_cshtml.ExecuteAsync()
    ```

    There are a lot of script code in the application, so it is difficult to find the specific lines of code that causes the crash. Does anyone have any ideas what could cause that or advice how to debug this issue?
    Comments: That's great to hear! Thanks for following up.

    0 0

    I am trying to run my application in a docker container, but it crashes with the following error:

    ```
    Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
    at std._Func_class<void>.()(_Func_class<void>* )
    at Microsoft.ClearScript.V8.NativeCallbackImpl.Invoke()
    at Microsoft.ClearScript.Util.MiscHelpers.Try(Action action)
    at Microsoft.ClearScript.Util.NativeCallbackTimer.OnTimer(Object state)
    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    at System.Threading.TimerQueueTimer.CallCallback()
    at System.Threading.TimerQueueTimer.Fire()
    at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
    at System.Threading.ThreadPoolWorkQueue.Dispatch()
    ```

    another exception

    ```
    Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
    at V8Context.Create(SharedPtr<V8Isolate>* , StdString* , Boolean , Boolean , Int32 )
    at Microsoft.ClearScript.V8.V8ContextProxyImpl..ctor(V8IsolateProxy gcIsolateProxy, String gcName, Boolean enableDebugging, Boolean disableGlobalMembers, Int32 debugPort)
    --- End of inner exception stack trace ---
    at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
    at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
    at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
    at System.Activator.CreateInstance(Type type, Object[] args)
    at Microsoft.ClearScript.V8.V8Proxy.CreateImpl[T](Object[] args)
    at Microsoft.ClearScript.V8.V8ScriptEngine..ctor(V8Runtime runtime, String name, V8RuntimeConstraints constraints, V8ScriptEngineFlags flags, Int32 debugPort)
    at JavaScriptEngineSwitcher.V8.V8JsEngine..ctor(V8Settings settings)
    at JavaScriptEngineSwitcher.V8.V8JsEngineFactory.CreateEngine()
    at React.JavaScriptEngineFactory.GetFactory(JsEngineSwitcher jsEngineSwitcher, Boolean allowMsie)
    at React.JavaScriptEngineFactory..ctor(JsEngineSwitcher jsEngineSwitcher, IReactSiteConfiguration config, IFileSystem fileSystem)
    at lambda_method(Closure , Object[] )
    at React.TinyIoC.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, NamedParameterOverloads parameters, ResolveOptions options)
    at React.TinyIoC.TinyIoCContainer.SingletonFactory.GetObject(Type requestedType, TinyIoCContainer container, NamedParameterOverloads parameters, ResolveOptions options)
    at React.TinyIoC.TinyIoCContainer.ResolveInternal(TypeRegistration registration, NamedParameterOverloads parameters, ResolveOptions options)
    at React.TinyIoC.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, NamedParameterOverloads parameters, ResolveOptions options)
    at React.TinyIoC.TinyIoCContainer.CustomObjectLifetimeFactory.GetObject(Type requestedType, TinyIoCContainer container, NamedParameterOverloads parameters, ResolveOptions options)
    at React.TinyIoC.TinyIoCContainer.ResolveInternal(TypeRegistration registration, NamedParameterOverloads parameters, ResolveOptions options)
    at React.TinyIoC.TinyIoCContainer.Resolve[ResolveType]()
    at React.AspNet.HtmlHelperExtensions.get_Environment()
    at React.AspNet.HtmlHelperExtensions.React[T](IHtmlHelper htmlHelper, String componentName, T props, String htmlTag, String containerId, Boolean clientOnly, Boolean serverOnly, String containerClass)
    at AspNetCore._Views_Site_Menu_cshtml.<ExecuteAsync>d__33.MoveNext() in /Views/Site/Menu.cshtml:line 3
    at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
    at AspNetCore._Views_Site_Menu_cshtml.ExecuteAsync()
    ```

    There are a lot of script code in the application, so it is difficult to find the specific lines of code that causes the crash. Does anyone have any ideas what could cause that or advice how to debug this issue?

    0 0

    I am trying to run my application in a docker container, but it crashes with the following error:

    ```
    Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
    at std._Func_class<void>.()(_Func_class<void>* )
    at Microsoft.ClearScript.V8.NativeCallbackImpl.Invoke()
    at Microsoft.ClearScript.Util.MiscHelpers.Try(Action action)
    at Microsoft.ClearScript.Util.NativeCallbackTimer.OnTimer(Object state)
    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    at System.Threading.TimerQueueTimer.CallCallback()
    at System.Threading.TimerQueueTimer.Fire()
    at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
    at System.Threading.ThreadPoolWorkQueue.Dispatch()
    ```

    another exception

    ```
    Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
    at V8Context.Create(SharedPtr<V8Isolate>* , StdString* , Boolean , Boolean , Int32 )
    at Microsoft.ClearScript.V8.V8ContextProxyImpl..ctor(V8IsolateProxy gcIsolateProxy, String gcName, Boolean enableDebugging, Boolean disableGlobalMembers, Int32 debugPort)
    --- End of inner exception stack trace ---
    at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
    at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
    at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
    at System.Activator.CreateInstance(Type type, Object[] args)
    at Microsoft.ClearScript.V8.V8Proxy.CreateImpl[T](Object[] args)
    at Microsoft.ClearScript.V8.V8ScriptEngine..ctor(V8Runtime runtime, String name, V8RuntimeConstraints constraints, V8ScriptEngineFlags flags, Int32 debugPort)
    at JavaScriptEngineSwitcher.V8.V8JsEngine..ctor(V8Settings settings)
    at JavaScriptEngineSwitcher.V8.V8JsEngineFactory.CreateEngine()
    at React.JavaScriptEngineFactory.GetFactory(JsEngineSwitcher jsEngineSwitcher, Boolean allowMsie)
    at React.JavaScriptEngineFactory..ctor(JsEngineSwitcher jsEngineSwitcher, IReactSiteConfiguration config, IFileSystem fileSystem)
    at lambda_method(Closure , Object[] )
    at React.TinyIoC.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, NamedParameterOverloads parameters, ResolveOptions options)
    at React.TinyIoC.TinyIoCContainer.SingletonFactory.GetObject(Type requestedType, TinyIoCContainer container, NamedParameterOverloads parameters, ResolveOptions options)
    at React.TinyIoC.TinyIoCContainer.ResolveInternal(TypeRegistration registration, NamedParameterOverloads parameters, ResolveOptions options)
    at React.TinyIoC.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, NamedParameterOverloads parameters, ResolveOptions options)
    at React.TinyIoC.TinyIoCContainer.CustomObjectLifetimeFactory.GetObject(Type requestedType, TinyIoCContainer container, NamedParameterOverloads parameters, ResolveOptions options)
    at React.TinyIoC.TinyIoCContainer.ResolveInternal(TypeRegistration registration, NamedParameterOverloads parameters, ResolveOptions options)
    at React.TinyIoC.TinyIoCContainer.Resolve[ResolveType]()
    at React.AspNet.HtmlHelperExtensions.get_Environment()
    at React.AspNet.HtmlHelperExtensions.React[T](IHtmlHelper htmlHelper, String componentName, T props, String htmlTag, String containerId, Boolean clientOnly, Boolean serverOnly, String containerClass)
    at AspNetCore._Views_Site_Menu_cshtml.<ExecuteAsync>d__33.MoveNext() in /Views/Site/Menu.cshtml:line 3
    at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
    at AspNetCore._Views_Site_Menu_cshtml.ExecuteAsync()
    ```

    There are a lot of script code in the application, so it is difficult to find the specific lines of code that causes the crash. Does anyone have any ideas what could cause that or advice how to debug this issue?

    0 0

    Potential fix for hang on application pool recycle (Issue #119).

    0 0

    Hi,

    Using React.NET 3.0.1 which uses ClearScript.V8 5.4.8 following hang is observed on recycling application pool
    ```
    .NET Call Stack


    .SharedPtr.Release(SharedPtr*)+d7
    [[InlinedCallFrame] (.Decrement)] .RefCount.Decrement(RefCount*)
    Microsoft.ClearScript.V8.V8ContextProxyImpl.!V8ContextProxyImpl()+4e
    Microsoft.ClearScript.V8.V8ContextProxyImpl.Dispose(Boolean)+1f
    [[DebuggerU2MCatchHandlerFrame]]
    [[ContextTransitionFrame]]
    [[GCFrame]]
    [[DebuggerU2MCatchHandlerFrame]]

    Full Call Stack

    ntdll!NtWaitForSingleObject+14
    KERNELBASE!WaitForSingleObjectEx+8f
    v8_x64!v8::Extension::dependencies+329ac
    v8_x64!v8::ExternalResourceVisitor::VisitExternalString+28187
    v8_x64!v8::ExternalResourceVisitor::VisitExternalString+1a3
    v8_x64!v8::ExternalResourceVisitor::VisitExternalString+533b
    ClearScriptV8_64+14216
    ClearScriptV8_64+120e4
    ClearScriptV8_64+13e3f
    ClearScriptV8_64+50a8
    <Module>.SharedPtr<V8Context>.Release(SharedPtr<V8Context>*)+d7
    [[InlinedCallFrame] (<Module>.Decrement)] <Module>.RefCount.Decrement(RefCount*)
    Microsoft.ClearScript.V8.V8ContextProxyImpl.!V8ContextProxyImpl()+4e
    Microsoft.ClearScript.V8.V8ContextProxyImpl.Dispose(Boolean)+1f
    clr!FastCallFinalizeWorker+6
    clr!ETW::GCLog::SendFinalizeObjectEvent+c9
    clr!MethodTable::CallFinalizer+b5
    clr!CallFinalizer+5e
    clr!FinalizerThread::DoOneFinalization+95
    clr!FinalizerThread::FinalizeAllObjects+133
    clr!FinalizerThread::FinalizeAllObjects_Wrapper+18
    clr!Frame::Push+59
    clr!PEDecoder::GetNativeCodeManagerTable+170
    clr!PEDecoder::GetNativeCodeManagerTable+99
    [[DebuggerU2MCatchHandlerFrame]]
    clr!Thread::ShouldChangeAbortToUnload+45
    clr!Thread::DoADCallBack+109
    [[ContextTransitionFrame]]
    clr!Frame::Push+a2
    clr!FinalizerThread::DoOneFinalization+1f9
    [[GCFrame]]
    clr!FinalizerThread::FinalizeAllObjects+133
    clr!FinalizerThread::FinalizerThreadWorker+bb
    clr!Frame::Push+59
    clr!PEDecoder::GetNativeCodeManagerTable+170
    clr!PEDecoder::GetNativeCodeManagerTable+99
    [[DebuggerU2MCatchHandlerFrame]]
    clr!FinalizerThread::FinalizerThreadStart+10a
    clr!Thread::intermediateThreadProc+86
    kernel32!BaseThreadInitThunk+14
    ntdll!RtlUserThreadStart+21
    ```

    0 0

    Hi,

    Using React.NET 3.0.1 which uses ClearScript.V8 5.4.8 following hang is observed on recycling application pool
    ```
    .NET Call Stack


    .SharedPtr.Release(SharedPtr*)+d7
    [[InlinedCallFrame] (.Decrement)] .RefCount.Decrement(RefCount*)
    Microsoft.ClearScript.V8.V8ContextProxyImpl.!V8ContextProxyImpl()+4e
    Microsoft.ClearScript.V8.V8ContextProxyImpl.Dispose(Boolean)+1f
    [[DebuggerU2MCatchHandlerFrame]]
    [[ContextTransitionFrame]]
    [[GCFrame]]
    [[DebuggerU2MCatchHandlerFrame]]

    Full Call Stack

    ntdll!NtWaitForSingleObject+14
    KERNELBASE!WaitForSingleObjectEx+8f
    v8_x64!v8::Extension::dependencies+329ac
    v8_x64!v8::ExternalResourceVisitor::VisitExternalString+28187
    v8_x64!v8::ExternalResourceVisitor::VisitExternalString+1a3
    v8_x64!v8::ExternalResourceVisitor::VisitExternalString+533b
    ClearScriptV8_64+14216
    ClearScriptV8_64+120e4
    ClearScriptV8_64+13e3f
    ClearScriptV8_64+50a8
    <Module>.SharedPtr<V8Context>.Release(SharedPtr<V8Context>*)+d7
    [[InlinedCallFrame] (<Module>.Decrement)] <Module>.RefCount.Decrement(RefCount*)
    Microsoft.ClearScript.V8.V8ContextProxyImpl.!V8ContextProxyImpl()+4e
    Microsoft.ClearScript.V8.V8ContextProxyImpl.Dispose(Boolean)+1f
    clr!FastCallFinalizeWorker+6
    clr!ETW::GCLog::SendFinalizeObjectEvent+c9
    clr!MethodTable::CallFinalizer+b5
    clr!CallFinalizer+5e
    clr!FinalizerThread::DoOneFinalization+95
    clr!FinalizerThread::FinalizeAllObjects+133
    clr!FinalizerThread::FinalizeAllObjects_Wrapper+18
    clr!Frame::Push+59
    clr!PEDecoder::GetNativeCodeManagerTable+170
    clr!PEDecoder::GetNativeCodeManagerTable+99
    [[DebuggerU2MCatchHandlerFrame]]
    clr!Thread::ShouldChangeAbortToUnload+45
    clr!Thread::DoADCallBack+109
    [[ContextTransitionFrame]]
    clr!Frame::Push+a2
    clr!FinalizerThread::DoOneFinalization+1f9
    [[GCFrame]]
    clr!FinalizerThread::FinalizeAllObjects+133
    clr!FinalizerThread::FinalizerThreadWorker+bb
    clr!Frame::Push+59
    clr!PEDecoder::GetNativeCodeManagerTable+170
    clr!PEDecoder::GetNativeCodeManagerTable+99
    [[DebuggerU2MCatchHandlerFrame]]
    clr!FinalizerThread::FinalizerThreadStart+10a
    clr!Thread::intermediateThreadProc+86
    kernel32!BaseThreadInitThunk+14
    ntdll!RtlUserThreadStart+21
    ```
    Comments: We've posted a potential fix [here](https://clearscript.codeplex.com/SourceControl/changeset/1db6dbc9d458ec5fafa15d5574a0e2709a1b220d). Since we haven't been able to reproduce the issue, it would be great if you could give it a try. As the fix is relative to ClearScript 5.4.9, you might pick up some performance improvements as well. Good luck, and thanks again!

    0 0

    Hi,

    Using React.NET 3.0.1 which uses ClearScript.V8 5.4.8 following hang is observed on recycling application pool
    ```
    .NET Call Stack


    .SharedPtr.Release(SharedPtr*)+d7
    [[InlinedCallFrame] (.Decrement)] .RefCount.Decrement(RefCount*)
    Microsoft.ClearScript.V8.V8ContextProxyImpl.!V8ContextProxyImpl()+4e
    Microsoft.ClearScript.V8.V8ContextProxyImpl.Dispose(Boolean)+1f
    [[DebuggerU2MCatchHandlerFrame]]
    [[ContextTransitionFrame]]
    [[GCFrame]]
    [[DebuggerU2MCatchHandlerFrame]]

    Full Call Stack

    ntdll!NtWaitForSingleObject+14
    KERNELBASE!WaitForSingleObjectEx+8f
    v8_x64!v8::Extension::dependencies+329ac
    v8_x64!v8::ExternalResourceVisitor::VisitExternalString+28187
    v8_x64!v8::ExternalResourceVisitor::VisitExternalString+1a3
    v8_x64!v8::ExternalResourceVisitor::VisitExternalString+533b
    ClearScriptV8_64+14216
    ClearScriptV8_64+120e4
    ClearScriptV8_64+13e3f
    ClearScriptV8_64+50a8
    <Module>.SharedPtr<V8Context>.Release(SharedPtr<V8Context>*)+d7
    [[InlinedCallFrame] (<Module>.Decrement)] <Module>.RefCount.Decrement(RefCount*)
    Microsoft.ClearScript.V8.V8ContextProxyImpl.!V8ContextProxyImpl()+4e
    Microsoft.ClearScript.V8.V8ContextProxyImpl.Dispose(Boolean)+1f
    clr!FastCallFinalizeWorker+6
    clr!ETW::GCLog::SendFinalizeObjectEvent+c9
    clr!MethodTable::CallFinalizer+b5
    clr!CallFinalizer+5e
    clr!FinalizerThread::DoOneFinalization+95
    clr!FinalizerThread::FinalizeAllObjects+133
    clr!FinalizerThread::FinalizeAllObjects_Wrapper+18
    clr!Frame::Push+59
    clr!PEDecoder::GetNativeCodeManagerTable+170
    clr!PEDecoder::GetNativeCodeManagerTable+99
    [[DebuggerU2MCatchHandlerFrame]]
    clr!Thread::ShouldChangeAbortToUnload+45
    clr!Thread::DoADCallBack+109
    [[ContextTransitionFrame]]
    clr!Frame::Push+a2
    clr!FinalizerThread::DoOneFinalization+1f9
    [[GCFrame]]
    clr!FinalizerThread::FinalizeAllObjects+133
    clr!FinalizerThread::FinalizerThreadWorker+bb
    clr!Frame::Push+59
    clr!PEDecoder::GetNativeCodeManagerTable+170
    clr!PEDecoder::GetNativeCodeManagerTable+99
    [[DebuggerU2MCatchHandlerFrame]]
    clr!FinalizerThread::FinalizerThreadStart+10a
    clr!Thread::intermediateThreadProc+86
    kernel32!BaseThreadInitThunk+14
    ntdll!RtlUserThreadStart+21
    ```
    Comments: I'm no longer able to reproduce this deadlock. It restarts successfully, but now crashes on start with automatic restart afterwards. Crash is intermittent. Weren't able to repro with attached debugger. Here is a stack trace ``` Exception: System.Reflection.TargetInvocationException Message: Exception has been thrown by the target of an invocation. StackTrace: at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark) at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at System.Activator.CreateInstance(Type type, Object[] args) at Microsoft.ClearScript.V8.V8Proxy.CreateImpl[T](Object[] args) at Microsoft.ClearScript.V8.V8ScriptEngine..ctor(V8Runtime runtime, String name, V8RuntimeConstraints constraints, V8ScriptEngineFlags flags, Int32 debugPort) at JavaScriptEngineSwitcher.V8.V8JsEngine..ctor(V8Settings settings) at JavaScriptEngineSwitcher.V8.V8JsEngineFactory.CreateEngine() at React.JavaScriptEngineFactory.GetFactory(JsEngineSwitcher jsEngineSwitcher, Boolean allowMsie) at React.JavaScriptEngineFactory..ctor(JsEngineSwitcher jsEngineSwitcher, IReactSiteConfiguration config, IFileSystem fileSystem) at lambda_method(Closure , Object[] ) at React.TinyIoC.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, NamedParameterOverloads parameters, ResolveOptions options) at React.TinyIoC.TinyIoCContainer.SingletonFactory.GetObject(Type requestedType, TinyIoCContainer container, NamedParameterOverloads parameters, ResolveOptions options) at React.TinyIoC.TinyIoCContainer.ResolveInternal(TypeRegistration registration, NamedParameterOverloads parameters, ResolveOptions options) at React.TinyIoC.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, NamedParameterOverloads parameters, ResolveOptions options) at React.TinyIoC.TinyIoCContainer.CustomObjectLifetimeFactory.GetObject(Type requestedType, TinyIoCContainer container, NamedParameterOverloads parameters, ResolveOptions options) at React.TinyIoC.TinyIoCContainer.ResolveInternal(TypeRegistration registration, NamedParameterOverloads parameters, ResolveOptions options) at React.TinyIoC.TinyIoCContainer.Resolve[ResolveType]() at React.Web.Mvc.HtmlHelperExtensions.get_Environment() at React.Web.Mvc.HtmlHelperExtensions.React[T](HtmlHelper htmlHelper, String componentName, T props, String htmlTag, String containerId, Boolean clientOnly, Boolean serverOnly, String containerClass) InnerException: System.AccessViolationException Message: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. StackTrace: at V8Context.Create(SharedPtr<V8Isolate>* , StdString* , Boolean , Boolean , Int32 ) at Microsoft.ClearScript.V8.V8ContextProxyImpl..ctor(V8IsolateProxy gcIsolateProxy, String gcName, Boolean enableDebugging, Boolean disableGlobalMembers, Int32 debugPort) ```

    0 0

    Hi,

    Using React.NET 3.0.1 which uses ClearScript.V8 5.4.8 following hang is observed on recycling application pool
    ```
    .NET Call Stack


    .SharedPtr.Release(SharedPtr*)+d7
    [[InlinedCallFrame] (.Decrement)] .RefCount.Decrement(RefCount*)
    Microsoft.ClearScript.V8.V8ContextProxyImpl.!V8ContextProxyImpl()+4e
    Microsoft.ClearScript.V8.V8ContextProxyImpl.Dispose(Boolean)+1f
    [[DebuggerU2MCatchHandlerFrame]]
    [[ContextTransitionFrame]]
    [[GCFrame]]
    [[DebuggerU2MCatchHandlerFrame]]

    Full Call Stack

    ntdll!NtWaitForSingleObject+14
    KERNELBASE!WaitForSingleObjectEx+8f
    v8_x64!v8::Extension::dependencies+329ac
    v8_x64!v8::ExternalResourceVisitor::VisitExternalString+28187
    v8_x64!v8::ExternalResourceVisitor::VisitExternalString+1a3
    v8_x64!v8::ExternalResourceVisitor::VisitExternalString+533b
    ClearScriptV8_64+14216
    ClearScriptV8_64+120e4
    ClearScriptV8_64+13e3f
    ClearScriptV8_64+50a8
    <Module>.SharedPtr<V8Context>.Release(SharedPtr<V8Context>*)+d7
    [[InlinedCallFrame] (<Module>.Decrement)] <Module>.RefCount.Decrement(RefCount*)
    Microsoft.ClearScript.V8.V8ContextProxyImpl.!V8ContextProxyImpl()+4e
    Microsoft.ClearScript.V8.V8ContextProxyImpl.Dispose(Boolean)+1f
    clr!FastCallFinalizeWorker+6
    clr!ETW::GCLog::SendFinalizeObjectEvent+c9
    clr!MethodTable::CallFinalizer+b5
    clr!CallFinalizer+5e
    clr!FinalizerThread::DoOneFinalization+95
    clr!FinalizerThread::FinalizeAllObjects+133
    clr!FinalizerThread::FinalizeAllObjects_Wrapper+18
    clr!Frame::Push+59
    clr!PEDecoder::GetNativeCodeManagerTable+170
    clr!PEDecoder::GetNativeCodeManagerTable+99
    [[DebuggerU2MCatchHandlerFrame]]
    clr!Thread::ShouldChangeAbortToUnload+45
    clr!Thread::DoADCallBack+109
    [[ContextTransitionFrame]]
    clr!Frame::Push+a2
    clr!FinalizerThread::DoOneFinalization+1f9
    [[GCFrame]]
    clr!FinalizerThread::FinalizeAllObjects+133
    clr!FinalizerThread::FinalizerThreadWorker+bb
    clr!Frame::Push+59
    clr!PEDecoder::GetNativeCodeManagerTable+170
    clr!PEDecoder::GetNativeCodeManagerTable+99
    [[DebuggerU2MCatchHandlerFrame]]
    clr!FinalizerThread::FinalizerThreadStart+10a
    clr!Thread::intermediateThreadProc+86
    kernel32!BaseThreadInitThunk+14
    ntdll!RtlUserThreadStart+21
    ```

    0 0

    Hi,

    Using React.NET 3.0.1 which uses ClearScript.V8 5.4.8 following hang is observed on recycling application pool
    ```
    .NET Call Stack


    .SharedPtr.Release(SharedPtr*)+d7
    [[InlinedCallFrame] (.Decrement)] .RefCount.Decrement(RefCount*)
    Microsoft.ClearScript.V8.V8ContextProxyImpl.!V8ContextProxyImpl()+4e
    Microsoft.ClearScript.V8.V8ContextProxyImpl.Dispose(Boolean)+1f
    [[DebuggerU2MCatchHandlerFrame]]
    [[ContextTransitionFrame]]
    [[GCFrame]]
    [[DebuggerU2MCatchHandlerFrame]]

    Full Call Stack

    ntdll!NtWaitForSingleObject+14
    KERNELBASE!WaitForSingleObjectEx+8f
    v8_x64!v8::Extension::dependencies+329ac
    v8_x64!v8::ExternalResourceVisitor::VisitExternalString+28187
    v8_x64!v8::ExternalResourceVisitor::VisitExternalString+1a3
    v8_x64!v8::ExternalResourceVisitor::VisitExternalString+533b
    ClearScriptV8_64+14216
    ClearScriptV8_64+120e4
    ClearScriptV8_64+13e3f
    ClearScriptV8_64+50a8
    <Module>.SharedPtr<V8Context>.Release(SharedPtr<V8Context>*)+d7
    [[InlinedCallFrame] (<Module>.Decrement)] <Module>.RefCount.Decrement(RefCount*)
    Microsoft.ClearScript.V8.V8ContextProxyImpl.!V8ContextProxyImpl()+4e
    Microsoft.ClearScript.V8.V8ContextProxyImpl.Dispose(Boolean)+1f
    clr!FastCallFinalizeWorker+6
    clr!ETW::GCLog::SendFinalizeObjectEvent+c9
    clr!MethodTable::CallFinalizer+b5
    clr!CallFinalizer+5e
    clr!FinalizerThread::DoOneFinalization+95
    clr!FinalizerThread::FinalizeAllObjects+133
    clr!FinalizerThread::FinalizeAllObjects_Wrapper+18
    clr!Frame::Push+59
    clr!PEDecoder::GetNativeCodeManagerTable+170
    clr!PEDecoder::GetNativeCodeManagerTable+99
    [[DebuggerU2MCatchHandlerFrame]]
    clr!Thread::ShouldChangeAbortToUnload+45
    clr!Thread::DoADCallBack+109
    [[ContextTransitionFrame]]
    clr!Frame::Push+a2
    clr!FinalizerThread::DoOneFinalization+1f9
    [[GCFrame]]
    clr!FinalizerThread::FinalizeAllObjects+133
    clr!FinalizerThread::FinalizerThreadWorker+bb
    clr!Frame::Push+59
    clr!PEDecoder::GetNativeCodeManagerTable+170
    clr!PEDecoder::GetNativeCodeManagerTable+99
    [[DebuggerU2MCatchHandlerFrame]]
    clr!FinalizerThread::FinalizerThreadStart+10a
    clr!Thread::intermediateThreadProc+86
    kernel32!BaseThreadInitThunk+14
    ntdll!RtlUserThreadStart+21
    ```
    Comments: An access violation inside native V8 initialization nearly always indicates an out-of-memory condition. When it fails to allocate resources, V8 immediately crashes the process by raising an access violation. At startup, a V8 runtime tries to acquire large amounts of memory and address space to be handed off to its internal resource manager. Any allocation failure leads to an immediate crash. Does your crash always happen _after_ a recycle? Or can it happen randomly at any time? Other questions: Does your application run in a 32-bit process? Is it possible that it creates a large number of V8 runtimes? Does it specify memory limits via `V8RuntimeConstraints`?

    0 0

    Hi,

    Using React.NET 3.0.1 which uses ClearScript.V8 5.4.8 following hang is observed on recycling application pool
    ```
    .NET Call Stack


    .SharedPtr.Release(SharedPtr*)+d7
    [[InlinedCallFrame] (.Decrement)] .RefCount.Decrement(RefCount*)
    Microsoft.ClearScript.V8.V8ContextProxyImpl.!V8ContextProxyImpl()+4e
    Microsoft.ClearScript.V8.V8ContextProxyImpl.Dispose(Boolean)+1f
    [[DebuggerU2MCatchHandlerFrame]]
    [[ContextTransitionFrame]]
    [[GCFrame]]
    [[DebuggerU2MCatchHandlerFrame]]

    Full Call Stack

    ntdll!NtWaitForSingleObject+14
    KERNELBASE!WaitForSingleObjectEx+8f
    v8_x64!v8::Extension::dependencies+329ac
    v8_x64!v8::ExternalResourceVisitor::VisitExternalString+28187
    v8_x64!v8::ExternalResourceVisitor::VisitExternalString+1a3
    v8_x64!v8::ExternalResourceVisitor::VisitExternalString+533b
    ClearScriptV8_64+14216
    ClearScriptV8_64+120e4
    ClearScriptV8_64+13e3f
    ClearScriptV8_64+50a8
    <Module>.SharedPtr<V8Context>.Release(SharedPtr<V8Context>*)+d7
    [[InlinedCallFrame] (<Module>.Decrement)] <Module>.RefCount.Decrement(RefCount*)
    Microsoft.ClearScript.V8.V8ContextProxyImpl.!V8ContextProxyImpl()+4e
    Microsoft.ClearScript.V8.V8ContextProxyImpl.Dispose(Boolean)+1f
    clr!FastCallFinalizeWorker+6
    clr!ETW::GCLog::SendFinalizeObjectEvent+c9
    clr!MethodTable::CallFinalizer+b5
    clr!CallFinalizer+5e
    clr!FinalizerThread::DoOneFinalization+95
    clr!FinalizerThread::FinalizeAllObjects+133
    clr!FinalizerThread::FinalizeAllObjects_Wrapper+18
    clr!Frame::Push+59
    clr!PEDecoder::GetNativeCodeManagerTable+170
    clr!PEDecoder::GetNativeCodeManagerTable+99
    [[DebuggerU2MCatchHandlerFrame]]
    clr!Thread::ShouldChangeAbortToUnload+45
    clr!Thread::DoADCallBack+109
    [[ContextTransitionFrame]]
    clr!Frame::Push+a2
    clr!FinalizerThread::DoOneFinalization+1f9
    [[GCFrame]]
    clr!FinalizerThread::FinalizeAllObjects+133
    clr!FinalizerThread::FinalizerThreadWorker+bb
    clr!Frame::Push+59
    clr!PEDecoder::GetNativeCodeManagerTable+170
    clr!PEDecoder::GetNativeCodeManagerTable+99
    [[DebuggerU2MCatchHandlerFrame]]
    clr!FinalizerThread::FinalizerThreadStart+10a
    clr!Thread::intermediateThreadProc+86
    kernel32!BaseThreadInitThunk+14
    ntdll!RtlUserThreadStart+21
    ```
    Comments: Today is the first time I observed this. I observed it only after recycle. IIS is running in 64-bit mode. V8RuntimeConstraints contain MaxNewSpaceSize = 0, MaxOldSpaceSize = 0, MaxExecutableSize = 0.

    0 0

    Hi,

    Using React.NET 3.0.1 which uses ClearScript.V8 5.4.8 following hang is observed on recycling application pool
    ```
    .NET Call Stack


    .SharedPtr.Release(SharedPtr*)+d7
    [[InlinedCallFrame] (.Decrement)] .RefCount.Decrement(RefCount*)
    Microsoft.ClearScript.V8.V8ContextProxyImpl.!V8ContextProxyImpl()+4e
    Microsoft.ClearScript.V8.V8ContextProxyImpl.Dispose(Boolean)+1f
    [[DebuggerU2MCatchHandlerFrame]]
    [[ContextTransitionFrame]]
    [[GCFrame]]
    [[DebuggerU2MCatchHandlerFrame]]

    Full Call Stack

    ntdll!NtWaitForSingleObject+14
    KERNELBASE!WaitForSingleObjectEx+8f
    v8_x64!v8::Extension::dependencies+329ac
    v8_x64!v8::ExternalResourceVisitor::VisitExternalString+28187
    v8_x64!v8::ExternalResourceVisitor::VisitExternalString+1a3
    v8_x64!v8::ExternalResourceVisitor::VisitExternalString+533b
    ClearScriptV8_64+14216
    ClearScriptV8_64+120e4
    ClearScriptV8_64+13e3f
    ClearScriptV8_64+50a8
    <Module>.SharedPtr<V8Context>.Release(SharedPtr<V8Context>*)+d7
    [[InlinedCallFrame] (<Module>.Decrement)] <Module>.RefCount.Decrement(RefCount*)
    Microsoft.ClearScript.V8.V8ContextProxyImpl.!V8ContextProxyImpl()+4e
    Microsoft.ClearScript.V8.V8ContextProxyImpl.Dispose(Boolean)+1f
    clr!FastCallFinalizeWorker+6
    clr!ETW::GCLog::SendFinalizeObjectEvent+c9
    clr!MethodTable::CallFinalizer+b5
    clr!CallFinalizer+5e
    clr!FinalizerThread::DoOneFinalization+95
    clr!FinalizerThread::FinalizeAllObjects+133
    clr!FinalizerThread::FinalizeAllObjects_Wrapper+18
    clr!Frame::Push+59
    clr!PEDecoder::GetNativeCodeManagerTable+170
    clr!PEDecoder::GetNativeCodeManagerTable+99
    [[DebuggerU2MCatchHandlerFrame]]
    clr!Thread::ShouldChangeAbortToUnload+45
    clr!Thread::DoADCallBack+109
    [[ContextTransitionFrame]]
    clr!Frame::Push+a2
    clr!FinalizerThread::DoOneFinalization+1f9
    [[GCFrame]]
    clr!FinalizerThread::FinalizeAllObjects+133
    clr!FinalizerThread::FinalizerThreadWorker+bb
    clr!Frame::Push+59
    clr!PEDecoder::GetNativeCodeManagerTable+170
    clr!PEDecoder::GetNativeCodeManagerTable+99
    [[DebuggerU2MCatchHandlerFrame]]
    clr!FinalizerThread::FinalizerThreadStart+10a
    clr!Thread::intermediateThreadProc+86
    kernel32!BaseThreadInitThunk+14
    ntdll!RtlUserThreadStart+21
    ```
    Comments: Would it be possible to collect a full native call stack? Since you built V8 and ClearScript locally, you should have all the necessary symbols.

    0 0

    Hi,

    Using React.NET 3.0.1 which uses ClearScript.V8 5.4.8 following hang is observed on recycling application pool
    ```
    .NET Call Stack


    .SharedPtr.Release(SharedPtr*)+d7
    [[InlinedCallFrame] (.Decrement)] .RefCount.Decrement(RefCount*)
    Microsoft.ClearScript.V8.V8ContextProxyImpl.!V8ContextProxyImpl()+4e
    Microsoft.ClearScript.V8.V8ContextProxyImpl.Dispose(Boolean)+1f
    [[DebuggerU2MCatchHandlerFrame]]
    [[ContextTransitionFrame]]
    [[GCFrame]]
    [[DebuggerU2MCatchHandlerFrame]]

    Full Call Stack

    ntdll!NtWaitForSingleObject+14
    KERNELBASE!WaitForSingleObjectEx+8f
    v8_x64!v8::Extension::dependencies+329ac
    v8_x64!v8::ExternalResourceVisitor::VisitExternalString+28187
    v8_x64!v8::ExternalResourceVisitor::VisitExternalString+1a3
    v8_x64!v8::ExternalResourceVisitor::VisitExternalString+533b
    ClearScriptV8_64+14216
    ClearScriptV8_64+120e4
    ClearScriptV8_64+13e3f
    ClearScriptV8_64+50a8
    <Module>.SharedPtr<V8Context>.Release(SharedPtr<V8Context>*)+d7
    [[InlinedCallFrame] (<Module>.Decrement)] <Module>.RefCount.Decrement(RefCount*)
    Microsoft.ClearScript.V8.V8ContextProxyImpl.!V8ContextProxyImpl()+4e
    Microsoft.ClearScript.V8.V8ContextProxyImpl.Dispose(Boolean)+1f
    clr!FastCallFinalizeWorker+6
    clr!ETW::GCLog::SendFinalizeObjectEvent+c9
    clr!MethodTable::CallFinalizer+b5
    clr!CallFinalizer+5e
    clr!FinalizerThread::DoOneFinalization+95
    clr!FinalizerThread::FinalizeAllObjects+133
    clr!FinalizerThread::FinalizeAllObjects_Wrapper+18
    clr!Frame::Push+59
    clr!PEDecoder::GetNativeCodeManagerTable+170
    clr!PEDecoder::GetNativeCodeManagerTable+99
    [[DebuggerU2MCatchHandlerFrame]]
    clr!Thread::ShouldChangeAbortToUnload+45
    clr!Thread::DoADCallBack+109
    [[ContextTransitionFrame]]
    clr!Frame::Push+a2
    clr!FinalizerThread::DoOneFinalization+1f9
    [[GCFrame]]
    clr!FinalizerThread::FinalizeAllObjects+133
    clr!FinalizerThread::FinalizerThreadWorker+bb
    clr!Frame::Push+59
    clr!PEDecoder::GetNativeCodeManagerTable+170
    clr!PEDecoder::GetNativeCodeManagerTable+99
    [[DebuggerU2MCatchHandlerFrame]]
    clr!FinalizerThread::FinalizerThreadStart+10a
    clr!Thread::intermediateThreadProc+86
    kernel32!BaseThreadInitThunk+14
    ntdll!RtlUserThreadStart+21
    ```
    Comments: Hi again, I've updated to latest JavaScriptEngineSwitcher today which includes your fix and seems like I'm not able to reproduce any of the above issues anymore. Thanks for your support!

    0 0

    Switched to MIT license for GitHub migration.

    0 0

    Hi,

    Using React.NET 3.0.1 which uses ClearScript.V8 5.4.8 following hang is observed on recycling application pool
    ```
    .NET Call Stack


    .SharedPtr.Release(SharedPtr*)+d7
    [[InlinedCallFrame] (.Decrement)] .RefCount.Decrement(RefCount*)
    Microsoft.ClearScript.V8.V8ContextProxyImpl.!V8ContextProxyImpl()+4e
    Microsoft.ClearScript.V8.V8ContextProxyImpl.Dispose(Boolean)+1f
    [[DebuggerU2MCatchHandlerFrame]]
    [[ContextTransitionFrame]]
    [[GCFrame]]
    [[DebuggerU2MCatchHandlerFrame]]

    Full Call Stack

    ntdll!NtWaitForSingleObject+14
    KERNELBASE!WaitForSingleObjectEx+8f
    v8_x64!v8::Extension::dependencies+329ac
    v8_x64!v8::ExternalResourceVisitor::VisitExternalString+28187
    v8_x64!v8::ExternalResourceVisitor::VisitExternalString+1a3
    v8_x64!v8::ExternalResourceVisitor::VisitExternalString+533b
    ClearScriptV8_64+14216
    ClearScriptV8_64+120e4
    ClearScriptV8_64+13e3f
    ClearScriptV8_64+50a8
    <Module>.SharedPtr<V8Context>.Release(SharedPtr<V8Context>*)+d7
    [[InlinedCallFrame] (<Module>.Decrement)] <Module>.RefCount.Decrement(RefCount*)
    Microsoft.ClearScript.V8.V8ContextProxyImpl.!V8ContextProxyImpl()+4e
    Microsoft.ClearScript.V8.V8ContextProxyImpl.Dispose(Boolean)+1f
    clr!FastCallFinalizeWorker+6
    clr!ETW::GCLog::SendFinalizeObjectEvent+c9
    clr!MethodTable::CallFinalizer+b5
    clr!CallFinalizer+5e
    clr!FinalizerThread::DoOneFinalization+95
    clr!FinalizerThread::FinalizeAllObjects+133
    clr!FinalizerThread::FinalizeAllObjects_Wrapper+18
    clr!Frame::Push+59
    clr!PEDecoder::GetNativeCodeManagerTable+170
    clr!PEDecoder::GetNativeCodeManagerTable+99
    [[DebuggerU2MCatchHandlerFrame]]
    clr!Thread::ShouldChangeAbortToUnload+45
    clr!Thread::DoADCallBack+109
    [[ContextTransitionFrame]]
    clr!Frame::Push+a2
    clr!FinalizerThread::DoOneFinalization+1f9
    [[GCFrame]]
    clr!FinalizerThread::FinalizeAllObjects+133
    clr!FinalizerThread::FinalizerThreadWorker+bb
    clr!Frame::Push+59
    clr!PEDecoder::GetNativeCodeManagerTable+170
    clr!PEDecoder::GetNativeCodeManagerTable+99
    [[DebuggerU2MCatchHandlerFrame]]
    clr!FinalizerThread::FinalizerThreadStart+10a
    clr!Thread::intermediateThreadProc+86
    kernel32!BaseThreadInitThunk+14
    ntdll!RtlUserThreadStart+21
    ```
    Comments: That's great to hear. Thank you very much!

    0 0

    Hi,

    Using React.NET 3.0.1 which uses ClearScript.V8 5.4.8 following hang is observed on recycling application pool
    ```
    .NET Call Stack


    .SharedPtr.Release(SharedPtr*)+d7
    [[InlinedCallFrame] (.Decrement)] .RefCount.Decrement(RefCount*)
    Microsoft.ClearScript.V8.V8ContextProxyImpl.!V8ContextProxyImpl()+4e
    Microsoft.ClearScript.V8.V8ContextProxyImpl.Dispose(Boolean)+1f
    [[DebuggerU2MCatchHandlerFrame]]
    [[ContextTransitionFrame]]
    [[GCFrame]]
    [[DebuggerU2MCatchHandlerFrame]]

    Full Call Stack

    ntdll!NtWaitForSingleObject+14
    KERNELBASE!WaitForSingleObjectEx+8f
    v8_x64!v8::Extension::dependencies+329ac
    v8_x64!v8::ExternalResourceVisitor::VisitExternalString+28187
    v8_x64!v8::ExternalResourceVisitor::VisitExternalString+1a3
    v8_x64!v8::ExternalResourceVisitor::VisitExternalString+533b
    ClearScriptV8_64+14216
    ClearScriptV8_64+120e4
    ClearScriptV8_64+13e3f
    ClearScriptV8_64+50a8
    <Module>.SharedPtr<V8Context>.Release(SharedPtr<V8Context>*)+d7
    [[InlinedCallFrame] (<Module>.Decrement)] <Module>.RefCount.Decrement(RefCount*)
    Microsoft.ClearScript.V8.V8ContextProxyImpl.!V8ContextProxyImpl()+4e
    Microsoft.ClearScript.V8.V8ContextProxyImpl.Dispose(Boolean)+1f
    clr!FastCallFinalizeWorker+6
    clr!ETW::GCLog::SendFinalizeObjectEvent+c9
    clr!MethodTable::CallFinalizer+b5
    clr!CallFinalizer+5e
    clr!FinalizerThread::DoOneFinalization+95
    clr!FinalizerThread::FinalizeAllObjects+133
    clr!FinalizerThread::FinalizeAllObjects_Wrapper+18
    clr!Frame::Push+59
    clr!PEDecoder::GetNativeCodeManagerTable+170
    clr!PEDecoder::GetNativeCodeManagerTable+99
    [[DebuggerU2MCatchHandlerFrame]]
    clr!Thread::ShouldChangeAbortToUnload+45
    clr!Thread::DoADCallBack+109
    [[ContextTransitionFrame]]
    clr!Frame::Push+a2
    clr!FinalizerThread::DoOneFinalization+1f9
    [[GCFrame]]
    clr!FinalizerThread::FinalizeAllObjects+133
    clr!FinalizerThread::FinalizerThreadWorker+bb
    clr!Frame::Push+59
    clr!PEDecoder::GetNativeCodeManagerTable+170
    clr!PEDecoder::GetNativeCodeManagerTable+99
    [[DebuggerU2MCatchHandlerFrame]]
    clr!FinalizerThread::FinalizerThreadStart+10a
    clr!Thread::intermediateThreadProc+86
    kernel32!BaseThreadInitThunk+14
    ntdll!RtlUserThreadStart+21
    ```

    0 0

    Hi,

    Using React.NET 3.0.1 which uses ClearScript.V8 5.4.8 following hang is observed on recycling application pool
    ```
    .NET Call Stack


    .SharedPtr.Release(SharedPtr*)+d7
    [[InlinedCallFrame] (.Decrement)] .RefCount.Decrement(RefCount*)
    Microsoft.ClearScript.V8.V8ContextProxyImpl.!V8ContextProxyImpl()+4e
    Microsoft.ClearScript.V8.V8ContextProxyImpl.Dispose(Boolean)+1f
    [[DebuggerU2MCatchHandlerFrame]]
    [[ContextTransitionFrame]]
    [[GCFrame]]
    [[DebuggerU2MCatchHandlerFrame]]

    Full Call Stack

    ntdll!NtWaitForSingleObject+14
    KERNELBASE!WaitForSingleObjectEx+8f
    v8_x64!v8::Extension::dependencies+329ac
    v8_x64!v8::ExternalResourceVisitor::VisitExternalString+28187
    v8_x64!v8::ExternalResourceVisitor::VisitExternalString+1a3
    v8_x64!v8::ExternalResourceVisitor::VisitExternalString+533b
    ClearScriptV8_64+14216
    ClearScriptV8_64+120e4
    ClearScriptV8_64+13e3f
    ClearScriptV8_64+50a8
    <Module>.SharedPtr<V8Context>.Release(SharedPtr<V8Context>*)+d7
    [[InlinedCallFrame] (<Module>.Decrement)] <Module>.RefCount.Decrement(RefCount*)
    Microsoft.ClearScript.V8.V8ContextProxyImpl.!V8ContextProxyImpl()+4e
    Microsoft.ClearScript.V8.V8ContextProxyImpl.Dispose(Boolean)+1f
    clr!FastCallFinalizeWorker+6
    clr!ETW::GCLog::SendFinalizeObjectEvent+c9
    clr!MethodTable::CallFinalizer+b5
    clr!CallFinalizer+5e
    clr!FinalizerThread::DoOneFinalization+95
    clr!FinalizerThread::FinalizeAllObjects+133
    clr!FinalizerThread::FinalizeAllObjects_Wrapper+18
    clr!Frame::Push+59
    clr!PEDecoder::GetNativeCodeManagerTable+170
    clr!PEDecoder::GetNativeCodeManagerTable+99
    [[DebuggerU2MCatchHandlerFrame]]
    clr!Thread::ShouldChangeAbortToUnload+45
    clr!Thread::DoADCallBack+109
    [[ContextTransitionFrame]]
    clr!Frame::Push+a2
    clr!FinalizerThread::DoOneFinalization+1f9
    [[GCFrame]]
    clr!FinalizerThread::FinalizeAllObjects+133
    clr!FinalizerThread::FinalizerThreadWorker+bb
    clr!Frame::Push+59
    clr!PEDecoder::GetNativeCodeManagerTable+170
    clr!PEDecoder::GetNativeCodeManagerTable+99
    [[DebuggerU2MCatchHandlerFrame]]
    clr!FinalizerThread::FinalizerThreadStart+10a
    clr!Thread::intermediateThreadProc+86
    kernel32!BaseThreadInitThunk+14
    ntdll!RtlUserThreadStart+21
    ```