agracio / edge-js

Run .NET and Node.js code in-process on Windows, macOS, and Linux

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AccessViolationException error occurs when C# executes NodeJS code

Net-18K opened this issue · comments

Let’s post the exception thread first:


System.AccessViolationException
   HResult=0x80004003
   Message=An attempt was made to read or write to protected memory. This usually indicates that other memory is corrupted.
   Source=edge_nativeclr
   StackTrace:
    In _atexit_helper(IntPtr func, UInt64* __pexit_list_size, IntPtr** __ponexitend_e, IntPtr** __ponexitbegin_e) in -\-Module-.cs: line 2853
    In _atexit_m(IntPtr func) in -\-Module-.cs: line 2939
    In ClrFunc.Initialize(Local<v8::Function>* , Func`2 func) in -\ClrFunc.cs: line 151
    In ClrFunc.Initialize(FunctionCallbackInfo<v8::Value>* info) in -\ClrFunc.cs: line 399
    In Nan.imp.?A0x8dda69af.FunctionCallbackWrapper(FunctionCallbackInfo<v8::Value>* info) in -\-Module-.cs: line 635

The strange thing is that I tested it in the console Demo and it passed completely, but when I integrated it into my WebApi project, the error System.AccessViolationException occurred. I don't understand what's causing this, it's been bothering me for a long time, already!

I also tried using [v9.3.5] obtained from https://github.com/agracio/edge-js/releases page(https://github.com/agracio/edge-js/releases/tag/v9. 3.5) version, but this error still occurs!

Hope to get a reply as soon as possible.

AccessViolationException should be resolved when using latest nuget package from https://www.nuget.org/packages/EdgeJs.
There were PRs that resolved that issue.