Skip to content
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

The CoreRT compiler fails with a StackOverflowException #653

Closed
YohDeadfall opened this issue Sep 26, 2018 · 16 comments
Closed

The CoreRT compiler fails with a StackOverflowException #653

YohDeadfall opened this issue Sep 26, 2018 · 16 comments
Labels
bug Something isn't working
Milestone

Comments

@YohDeadfall
Copy link
Contributor

From dotnet/corert#6372 by @frankzye.


I came an error:

Unhandled Exception: System.InvalidOperationException: A suitable constructor for type 'Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlExecutionStrategyFactory' could not be located. Ensure the type is concrete and services are registered for all parameters of a public constructor.

So I added the following lines to RD.xml:

<Assembly Name="Npgsql.EntityFrameworkCore.PostgreSQL">
  <Type Name="Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlExecutionStrategyFactory" Dynamic="Required All"/>
</Assembly>

But when I compile, it throw an error "Process is terminating due to StackOverflowException", microsoft.dotnet.ilcompiler\1.0.0-alpha-26919-01\build\Microsoft.NETCore.Native.targets(200,5): error MSB3073 xxx runtime.win-x64.microsoft.dotnet.ilcompiler\1.0.0-alpha-26919-01\tools\ilc" @"obj\release\netcoreapp2.1\win-x64\native\DataExplorer.ilc.rsp exit.

@frankzye
Copy link

any update?

@YohDeadfall
Copy link
Contributor Author

YohDeadfall commented Oct 1, 2018

Not yet. Will try to take a look at the upcoming weekend.

@YohDeadfall
Copy link
Contributor Author

@frankzye Could you post a minimal repro for the issue? Currently I'm getting another error:

error MSB4184: The expression ""System.String[]".GetValue(1)" cannot be evaluated. Index was outside the bounds of the array.

@MichalStrehovsky Is there any way to get the method name which is failed to compile?

@frankzye
Copy link

Sample.zip
@YohDeadfall please find the repo, and help to resolve, thanks.

@frankzye
Copy link

@YohDeadfall How are things going?

@YohDeadfall
Copy link
Contributor Author

I had no time to contribute for the last two weeks, sorry.

@roji @austindrenski Would you like to take a look at it?

@roji
Copy link
Member

roji commented Oct 28, 2018

I definitely won't have any bandwidth for this in the next few weeks... Possible afterwards

@austindrenski
Copy link
Contributor

austindrenski commented Oct 28, 2018

I'm cleaning up the provided sample now to repost as a repo. I haven't worked with the AOT toolchain before, but I'll see what I can do.

See: https://github.com/austindrenski/EFCore.PG-653

Related

dotnet/corert#6477

@austindrenski
Copy link
Contributor

So it seems like whatever is triggering this is happening within Database.Migrate(). But commenting out that line reveals a whole sequence of additional EF Core metadata issues.

Thankfully, it looks like some serious legwork has been done in dotnet/corert#6477 by @rubin55 and @MichalStrehovsky to document these issues. I'm working my way though those now before debugging the issue in the migrations code.

@roji roji added this to the Backlog milestone Nov 14, 2018
@roji
Copy link
Member

roji commented Nov 14, 2018

I'm guessing that many/most of these issues are going to be EF Core-related, rather than specific to Npgsql - it's better to raise these with the EF Core team. I have no idea what the status of EF Core CortRT support is, or whether full CoreRT is a goal of theirs.

@austindrenski
Copy link
Contributor

I'm guessing that many/most of these issues are going to be EF Core-related, rather than specific to Npgsql - it's better to raise these with the EF Core team.

That was my impression after putting in a few hours with it. I would be interested to see a working version, so if anyone makes headway, please keep us in the loop by updating here.

@MichalStrehovsky
Copy link

@rubin55 got EF core working in dotnet/corert#6477. It's about finding all the places where EF uses reflection.

@roji
Copy link
Member

roji commented Nov 15, 2018

FWIW if EF Core is made to work, the Npgsql provider shouldn't be much effort beyond that - I don't think we do much that's reflection-based.

@eyupkayadarcin
Copy link

Any update ?

@roji
Copy link
Member

roji commented Jun 18, 2019

Not really... dotnet/corert#6477 still seems open even though @MichalStrehovsky mentioned he got EF Core working. The best way forward here is to see whether EF Core works on CoreRT with one of the built-in providers (SqlServer, Sqlient). If they do where Npgsql fails, then we should look into it, otherwise the issue belongs on the EF Core/CoreRT side.

@roji
Copy link
Member

roji commented Sep 27, 2019

Am closing this as a general EF Core issue (dotnet/corert#6477). If, after EF Core works on CoreRT, we find a specific issue with the Npgsql provider (unlikely), we can revisit.

@roji roji closed this as completed Sep 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants