Quantcast
Channel: ClearScript
Viewing all articles
Browse latest Browse all 2297

New Post: Problem using V8RuntimeConstraints

0
0
I'm running into a problem trying to use V8RuntimeConstraints when creating a V8ScriptEngine, and I'm not doing anything weird so I'm guessing there must be something wrong with my project. I'm posting here in case anyone else has hit this and has a suggestion.

I'm using ClearScript 5.4.0 built myself from the official download. If I don't pass in any constraints, everything works fine. With constraints, I get a System.Reflection.TargetInvocationException when V8Proxy tries to create an instance of V8ContextProxyImpl.

The details:

Code:

var constraints = new V8RuntimeConstraints();
constraints .MaxExecutableSize = 1024*1024;
constraints .MaxNewSpaceSize = 1024 * 1024;
constraints .MaxOldSpaceSize = 1024 * 1024;

var engine = new V8ScriptEngine(EngineConstraints); // Exception thrown in here

The exception:
  • $exception {"Exception has been thrown by the target of an invocation."} System.Exception {System.Reflection.TargetInvocationException}
  • [System.Reflection.TargetInvocationException] {"Exception has been thrown by the target of an invocation."} System.Reflection.TargetInvocationException
    _className  null    string
  • _data {System.Collections.ListDictionaryInternal} System.Collections.IDictionary {System.Collections.ListDictionaryInternal}
    _dynamicMethods null    object
    _exceptionMethod    null    System.Reflection.MethodBase
    _exceptionMethodString  null    string
    _helpURL    null    string
    _HResult    -2146232828 int
  • _innerException {"Attempted to read or write protected memory. This is often an indication that other memory is corrupt."} System.Exception {System.AccessViolationException}
  • _ipForWatsonBuckets 0 System.UIntPtr
    _message    "Exception has been thrown by the target of an invocation." string
    _remoteStackIndex   0   int
    _remoteStackTraceString null    string
  • _safeSerializationManager {System.Runtime.Serialization.SafeSerializationManager} System.Runtime.Serialization.SafeSerializationManager
    _source null    string
  • _stackTrace {sbyte[48]} object {sbyte[]}
    _stackTraceString   null    string
  • _watsonBuckets {byte[5616]} object {byte[]}
    _xcode  -532462766  int
  • _xptrs 0 System.IntPtr
  • Data {System.Collections.ListDictionaryInternal} System.Collections.IDictionary {System.Collections.ListDictionaryInternal}
    HelpLink    null    string
    HResult -2146232828 int
  • InnerException {"Attempted to read or write protected memory. This is often an indication that other memory is corrupt."} System.Exception {System.AccessViolationException}
  • IPForWatsonBuckets 0 System.UIntPtr
    IsTransient false   bool
    Message "Exception has been thrown by the target of an invocation." string
    RemoteStackTrace    null    string
    Source  "mscorlib"  string
    StackTrace  "   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)\r\n   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)"   string
  • TargetSite {System.Object InvokeMethod(System.Object, System.Object[], System.Signature, Boolean)} System.Reflection.MethodBase {System.Reflection.RuntimeMethodInfo}
  • WatsonBuckets {byte[5616]} object {byte[]}
  • Static members
Seems like there's a bad pointer or something at the C++ level. I have no idea why that would be going wrong. Any ideas?

Viewing all articles
Browse latest Browse all 2297

Latest Images

Trending Articles





Latest Images