Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

SQLite EF Core crashed on AOT #31870

Closed
HastiNouri opened this issue Sep 25, 2023 · 4 comments
Closed

SQLite EF Core crashed on AOT #31870

HastiNouri opened this issue Sep 25, 2023 · 4 comments

Comments

@HastiNouri
Copy link

HastiNouri commented Sep 25, 2023

Description

I'm unsure whether this problem pertains to EFCore or .NET MAUI
But I have discovered that my application runs successfully with EFCore-SQLite only in debug mode(JIT Compiler)
Whenever I switch to AOT mode, it crashes.
EFCore version: 8.0.0-rc.1.23419.6

Steps to Reproduce

No response

Link to public reproduction project repository

No response

Version with bug

8.0.0-rc.1.9171

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

8.0.0-preview.7.8842

Affected platforms

Android

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

android.runtime.JavaProxyThrowable: [System.ArgumentNullException]: ArgumentNull_Generic Arg_ParamName_Name, source
	at System.Linq.ThrowHelper.ThrowArgumentNullException(Unknown Source:0)
	at System.Linq.Enumerable.All(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.Metadata.Conventions.ValueGenerationConvention.GetValueGenerated(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.Metadata.Conventions.RelationalValueGenerationConvention.GetValueGenerated(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.Metadata.Conventions.RelationalValueGenerationConvention.GetValueGenerated(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.Metadata.Conventions.ValueGenerationConvention.ProcessEntityTypePrimaryKeyChanged(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher+ImmediateConventionScope.OnEntityTypePrimaryKeyChanged(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher+OnEntityTypePrimaryKeyChangedNode.Run(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher+DelayedConventionScope.Run(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher+ConventionBatch.Run(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher+ConventionBatch.Dispose(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher+ImmediateConventionScope.OnModelInitialized(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher.OnModelInitialized(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.Metadata.Internal.Model..ctor(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.ModelBuilder..ctor(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.ModelConfigurationBuilder.CreateModelBuilder(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.Infrastructure.ModelSource.CreateModel(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.Infrastructure.ModelSource.GetModel(Unknown Source:0)
@samhouts samhouts transferred this issue from dotnet/maui Sep 25, 2023
@ghost ghost added the untriaged label Sep 25, 2023
@ghost
Copy link

ghost commented Sep 25, 2023

Tagging subscribers to this area: @dotnet/area-meta
See info in area-owners.md if you want to be subscribed.

Issue Details

Description

I'm unsure whether this problem pertains to EFCore or .NET MAUI
But I have discovered that my application runs successfully with EFCore-SQLite only in debug mode(JIT Compiler)
Whenever I switch to AOT mode, it crashes.
EFCore version: 8.0.0-rc.1.23419.6

Steps to Reproduce

No response

Link to public reproduction project repository

No response

Version with bug

8.0.0-rc.1.9171

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

8.0.0-preview.7.8842

Affected platforms

Android

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

android.runtime.JavaProxyThrowable: [System.ArgumentNullException]: ArgumentNull_Generic Arg_ParamName_Name, source
	at System.Linq.ThrowHelper.ThrowArgumentNullException(Unknown Source:0)
	at System.Linq.Enumerable.All(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.Metadata.Conventions.ValueGenerationConvention.GetValueGenerated(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.Metadata.Conventions.RelationalValueGenerationConvention.GetValueGenerated(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.Metadata.Conventions.RelationalValueGenerationConvention.GetValueGenerated(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.Metadata.Conventions.ValueGenerationConvention.ProcessEntityTypePrimaryKeyChanged(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher+ImmediateConventionScope.OnEntityTypePrimaryKeyChanged(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher+OnEntityTypePrimaryKeyChangedNode.Run(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher+DelayedConventionScope.Run(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher+ConventionBatch.Run(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher+ConventionBatch.Dispose(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher+ImmediateConventionScope.OnModelInitialized(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher.OnModelInitialized(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.Metadata.Internal.Model..ctor(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.ModelBuilder..ctor(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.ModelConfigurationBuilder.CreateModelBuilder(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.Infrastructure.ModelSource.CreateModel(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.Infrastructure.ModelSource.GetModel(Unknown Source:0)
Author: KhadijeNouri
Assignees: -
Labels:

area-Meta

Milestone: -

@ghost
Copy link

ghost commented Sep 26, 2023

Tagging subscribers to 'linkable-framework': @eerhardt, @vitek-karas, @LakshanF, @sbomer, @joperezr, @marek-safar
See info in area-owners.md if you want to be subscribed.

Issue Details

Description

I'm unsure whether this problem pertains to EFCore or .NET MAUI
But I have discovered that my application runs successfully with EFCore-SQLite only in debug mode(JIT Compiler)
Whenever I switch to AOT mode, it crashes.
EFCore version: 8.0.0-rc.1.23419.6

Steps to Reproduce

No response

Link to public reproduction project repository

No response

Version with bug

8.0.0-rc.1.9171

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

8.0.0-preview.7.8842

Affected platforms

Android

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

android.runtime.JavaProxyThrowable: [System.ArgumentNullException]: ArgumentNull_Generic Arg_ParamName_Name, source
	at System.Linq.ThrowHelper.ThrowArgumentNullException(Unknown Source:0)
	at System.Linq.Enumerable.All(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.Metadata.Conventions.ValueGenerationConvention.GetValueGenerated(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.Metadata.Conventions.RelationalValueGenerationConvention.GetValueGenerated(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.Metadata.Conventions.RelationalValueGenerationConvention.GetValueGenerated(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.Metadata.Conventions.ValueGenerationConvention.ProcessEntityTypePrimaryKeyChanged(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher+ImmediateConventionScope.OnEntityTypePrimaryKeyChanged(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher+OnEntityTypePrimaryKeyChangedNode.Run(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher+DelayedConventionScope.Run(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher+ConventionBatch.Run(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher+ConventionBatch.Dispose(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher+ImmediateConventionScope.OnModelInitialized(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher.OnModelInitialized(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.Metadata.Internal.Model..ctor(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.ModelBuilder..ctor(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.ModelConfigurationBuilder.CreateModelBuilder(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.Infrastructure.ModelSource.CreateModel(Unknown Source:0)
	at Microsoft.EntityFrameworkCore.Infrastructure.ModelSource.GetModel(Unknown Source:0)
Author: KhadijeNouri
Assignees: -
Labels:

area-Meta, untriaged, linkable-framework

Milestone: -

@marek-safar marek-safar transferred this issue from dotnet/runtime Sep 26, 2023
@AndriySvyryd
Copy link
Member

EF is not yet AOT-compatible as of 8.0
Duplicate of #29761

@AndriySvyryd AndriySvyryd closed this as not planned Won't fix, can't repro, duplicate, stale Sep 29, 2023
@taori
Copy link

taori commented Jan 6, 2024

There should be an analyzer warning when using the package in .net 8. Having 8.x of efcore randomly crash at runtime when in works in debug is rather confusing

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

4 participants