-
Notifications
You must be signed in to change notification settings - Fork 640
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AccessViolationException when running inside of a AppDomain #586
Comments
I turned on the EDGE_DEBUG environment variable and this is what it prints
|
I have merged #573 to |
Thanks!, @agracio Can you also publish the nuget version also? |
Unfortunately I haven't gotten around to creating nuget package, but you can grab pre-compiled binaries from the release page https://github.com/agracio/edge-js/releases/tag/v8.2.2. |
@agracio I am trying to validate with the zip you linked to but I am getting this error
|
Not sure what it means, do note that it was built using NodeJs 8.2.1. Perhaps try using npm module directly without relying on zip package. |
Hmm, got the same thing with NPM. Not sure if I am doing something wrong though. |
Library build is working fine in both Linux and Windows test environments. Travis: https://travis-ci.org/agracio/edge-js. Appveyor: https://ci.appveyor.com/project/agracio/edge-js. |
v8.4.0 |
Just tried creating a test NodeJs project, ran
Runs without any problems. Haven't tried to run NodeJs from .NET app though. |
Hmm, I wonder what the issue is. The version I consume directly from Nuget (8.2.1) works fine. Is there anything different that happens in the nuget packaging process? |
To my knowledge I use the same process to build the package. Or at least thats what I think :) |
Could you try the nuget package and send it to me so I can try that? I tried myself but I am hitting lots of issues running build_double. |
Not sure what you mean by trying nuget package and sending it to you :) |
Here is my repro of the original issue. And if you build and then run
I tried then replacing with your dll and got the invalid application issue. |
Yep, same thing happens on my PC too, something is wrong with the build process. Will try rebuilding. |
Well, at least I am not crazy ;) |
No luck so far, tried rebuilding multiple times following these steps: https://github.com/agracio/edge-js#building-edgejs-nuget-package, but keep getting |
@agracio What is your other idea? |
Setting up a Windows 7 Azure VM with VS2015. Will try to build on it instead of my personal PC. |
Any idea what the issue could be?
…On Fri, Sep 15, 2017, 4:17 AM agracio ***@***.***> wrote:
Setting up a Windows 7 Azure VM with VS2015. Will try to build using on it
instead of my personal PC.
Not very optimistic to be honest since my PC successfully builds all the
binaries in /lib/native/ folders, it is unlikely that different build setup
would help.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#586 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AASlGn7XKfbcUVOhF5txAzXT6m2PbhsFks5silzbgaJpZM4PD7bT>
.
|
Ok, so here is where i got to so far. Now about the binary build.
I will continue to work on x86 binary but in the meantime let me know your thoughts on the above, |
Looking at docs it says that error can be caused by this:
But not sure how that could happen since the code waits on the EdgeJs task before continuing.
|
So that actually explains the problem, unmanaged code is still executing. I noticed that in my Node.js -> .NET apps edge unmanaged code continues to run after the call is completed. You could handle exception or manage creating/unloading app domain elsewhere. Whats important here is that #573 appears to solve AccessViolationException problem. As soon as I figure out how to compile x86 correctly I will post binaries. |
Interesting, how can c# know when the native work is done? |
.NET cannot really have control over unmanaged resources. Unfortunately I work with large .NET applications that use unmanaged components and when you really need to terminate native component and free all the resources it is holding the only sure way it to terminate and restart .NET process itself. |
Cool sounds fine. Any idea what the x64 issue remaining is? |
The issue is with x86 build, I got x64 working. Your solution is set to 32 bit and was using x86 binary. |
Ok, so there is not issue in the build? Then the PR is all ready to merge? Do we need to merge your build fixes into it? |
This is not the only PR that is ready to be merged ;) The entire reason I maintain a fork is the fixes it has that have not been merged to |
Ok, can you give me the updated zip of the dlls so I can at least unblock my project. |
Latest binaries are attached to v.8.2.5 release. Only x64 binary works, so make sure your projects are not set to build at 32 bit like the test project you shared. |
Any idea what the issue is with x86? Why doesn't it work?
…On Sun, Sep 24, 2017, 1:30 AM agracio ***@***.***> wrote:
Latest binaries are attached to v.8.2.5
<https://github.com/agracio/edge-js/releases/tag/v8.2.5> release. Only
x64 binary works, so make sure your projects are not set to build at 32 bit
like the test project you shared.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#586 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AASlGv0NRRtZWU3bcIMjkd3b7SAvF1Myks5slhMmgaJpZM4PD7bT>
.
|
Not really, something is wrong with the build process but I cannot figure it out. See if you have better luck. Start with this fix to |
Hmm, Ill try. Last time when I ran build_double, it failed on some other error. But will try again and see. |
Yea, this is what I get trying to build
|
Looks like error during gyp config rather than compile error. Are you able to build just edge by running something like |
That seems to work ok
|
The issue with the x86 build is due to build_double.bat: "%SELF%\build\repl.exe" ./build/edge_nativeclr.vcxproj "%USERPROFILE%.node-gyp%1%2\node.lib" "%SELF%build\node-%1-%2\node.lib" %2 is x86 -- but it needs to be ia32 for %USERPROFILE%.node-gyp%1%2\node.lib I changed it to: and changed the calling lines to: After this, the win32 version ran fine. As an aside, has anybody managed to get the 8.9.0 (LTS) version of node building? I end up with a bunch of "cannot convert argument 1 from 'nullptr' to 'nullptr &&'" errors... |
@Michael-Tajmajer-Emrsn That is awesome. @agracio could you take his change and build updated binaries for me? |
@Michael-Tajmajer-Emrsn thanks for this update, I've merged your PR and both x86 and x64 binaries are now working fine. Latest |
Binaries are now also published to NuGet |
Note: This may be related to#383 but I am filing separately since it has its own unique repro
When I try to run very simple JS code from EdgeJS it throws a AccessViolationException when run inside of an appdomain (see stack below) 100% of the time.
This happens from my sample code below and from inside of an xunit unit test.
This code reproduces the issue:
The text was updated successfully, but these errors were encountered: