Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

StackOverflowException during Edge compiling of c# using .Net Core #31

Open
SeanSnyders opened this issue Feb 27, 2017 · 10 comments
Open

Comments

@SeanSnyders
Copy link

SeanSnyders commented Feb 27, 2017

Trying to use Electron, Edge, and .Net Core.
I'm getting a StackOverflowException when trying to call a method in my own compiled .Net Core assembly.

I followed the suggested additions to the .Net Core project setup etc as described here and here as per Edge documentation.

On Windows 10, using versions:

image

I set up a test project here to illustrate the problem: https://github.com/SeanSnyders/TestExamples/tree/master/Test-Electron-Edge-DotNetCore

To build and run, follow general instructions as per the project readme.md:
npm install
npm run rebuild
npm start

If I change this line
image

to use bridge-inline.js it works fine, but using bridge-external.js and calling the TestMe method in the .NET Core compiled assembly gives me a StackOverflowException during the Edge JIT compiling of the c# code, as illustrated by the trace output when the environment variable COREHOST_TRACE=1 is set:

image

I've tried various things to fix this. Playing around with EDGE_APP_ROOT etc, but no solution just yet.
Is there a problem with the environment, or can Edge not find my assembly? Would be odd giving a StackoverflowException though....

Help appreciated!

@SeanSnyders
Copy link
Author

SeanSnyders commented Feb 27, 2017

Oh, in contrast, using VS2015 and .Net 4.6.1 it works fine to call c# methods in an external library as depicted in bridge-external.js.

@SeanSnyders
Copy link
Author

Ping? Anyone monitoring these issues?

@SeanSnyders
Copy link
Author

It seems that the problem might not be limited to .Net Core. I'm seeing the StackOverflowException on OSX as well using Mono 4.6:
image

When setting the EDGE_USE_CORECLR=1 env variable, the error looks like this on OSX:
image

So it seems there is definitely something going on in Edge and is not necessarily specific to .Net Core per se.

@SeanSnyders
Copy link
Author

After doing some digging around in a Debug compile of Edge, I can confirm that this is an Edge issue. See tjanczuk#526 (comment)

@tjanczuk @kexplo Is it possible to move this issue to the Edge repo please?

@vjpudelski
Copy link

I have the same issue. I am receiving an error in the .NET code of an electron-edge call. Is there an available fix? I am on electron-edge 6.5.5, node 6.11.0 and electron 1.7.8.

@agracio
Copy link

agracio commented Apr 9, 2018

Try using electron-edge-js and let me know if you still experience the issue.

@vjpudelski
Copy link

I don't appear to get the StackOverflowException anymore but the application also doesn't return from the .NET dll if an exception is thrown from the dll. Shouldn't the exception be deserialized into the error object of the callback function?

@agracio
Copy link

agracio commented Apr 9, 2018

It should, do you know what exception you .NET code is throwing?

@vjpudelski
Copy link

you are correct it appears to be coming through now... Thanks...

What is the difference from electron-edge and electron-edge-js?

@agracio
Copy link

agracio commented Apr 9, 2018

https://github.com/agracio/electron-edge-js the differences are in the readme, the main difference is that its based on https://github.com/agracio/edge-js that has some major bug fixes compared to original Edge.js repo with StackOverflowException being one of them.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants