-
Notifications
You must be signed in to change notification settings - Fork 473
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
[feature/netcore] An System.AccessViolationException is raised when attempting to use $apply=aggregate #1221
Comments
@techniq - Do you have a sample project or controller snippet you can share, specifically the integration with Remotion.Linq? |
@robward-ms thanks. Do you still need a sample project? It sounds like the E2E tests should show the same. If so, how should I provide it (where to upload, etc)? Thanks for your help. |
@techniq - The E2E won't test Remotion.Linq but it will test Aggregation and I did see the same exception you reported here. If you have a project, just push it to a branch/repo under your username and put the link here. Thanks - R |
@techniq - There are a few errors popping up, let's address each one: a.) EFCore 2.0 - Aggregation fails due to lack of AsQueryable support, the original for EF Core 6132.: b.) Remotion.Linq v2.2.0-alpha.5 and EFCore 2.0 - Aggregation fails with c.) EF Core 2.1.0-preview2-30148 - This is designed to work with Remotion.Linq v2.2.0-alpha.5 or better and longer throws the NotImplemented exception as in the first case or AccessviolationException as in the second case but also does not return the correct result. WebApi constructs LINQ queries to run against EF Core and those are failing at the moment. I have seen both invalid column ID and So at the moment, I think EF Core 2.1.0 or better is required and there seems to be a bug in the LINQ generation for EF Core. I'll continue to investigate this last issue in the context of this GitHub issue, i.e. I'll not focus on the |
That all makes since and sounds good to me. Thanks for digging into it.
…On Tue, Feb 20, 2018, 8:07 PM Rob Ward ***@***.***> wrote:
@techniq <https://github.com/techniq> - There are a few errors popping
up, let's address each one:
a.) EFCore 2.0 - Aggregation fails due to lack of AsQueryable support, the
original for EF Core 6132.
<dotnet/efcore#6132>: This
overload of the method 'System.Linq.Queryable.AsQueryable' is currently not
supported.
b.) Remotion.Linq v2.2.0-alpha.5 and EFCore 2.0 - Aggregation fails with
System.AccessViolationException in OData. Seen when using these assembly
redirect; EF Core 2.0.0 was not released to work with Remotion.Linq v2.2.0.
I'm inclined to think of this as a compatibility issues when those two
versions.
c.) EF Core 2.1.0-preview2-30148 - This is designed to work with
Remotion.Linq v2.2.0-alpha.5 or better and longer throws the NotImplemented
exception as in the first case or AccessviolationException as in the second
case but also does not return the correct result.
WebApi constructs LINQ queries to run against EF Core and those are
failing at the moment. I have seen both invalid column ID and Object
reference not set to an instance of an object thrown when enumerating the
LINQ query WebApi constructed against EF Core.
So at the moment, I think EF Core 2.1.0 or better is required and there
seems to be a bug in the LINQ generation for EF Core. I'll continue to
investigate this last issue in the context of this GitHub issue, i.e. I'll
not focus on the AccessViolationException or NotImplementedException, let
me know if that sounds wrong to you.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1221 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAK1RIAQtHueJWRpuDLFBri6ry9t1uCfks5tW2xYgaJpZM4Rpv8v>
.
|
@techniq - After looking at it a bit more, I think what I'm now seeing could present itself as an |
@techniq - OK, what I'm seeing is not something that would show up as an AV, it's caused by lack of lazy-loading in EFCore:
In the AggregateNavigationPropertyWorks test, the Customers IQueryable<> is returned from the controller without any Order objects. When then EnableQueryAttribute class runs the query, there is no result since the Orders are null. First thing I tried as forcing the result to include Orders, i.e. I was able to get the test to pass only by running the query over an in-memory IQueryable, i.e. I have a branch with the EFCore version of Aggregtion tests + solution here: https://github.com/robward-ms/WebApi/tree/NetCore-E2ECore-EFCore |
@robward-ms are you still seeing these issues with EF Core 2.1 RC1? BTW, we have support for lazy loading, but it needs to be enabled explicitly.
I would expect this to work. Where is the exception coming from? EF Core 2.1 also supports translating LINQ GroupBy with aggregates to GROUP BY in SQL. I am not super familiar with OData aggregate, but wouldn't it be ideal to leverage is rather than computing the count in memory? |
Still crashing/killing the process when running on dotnet/EF Core/ASP.NET |
Fix #1728 was merged. Could you validate with 7.2.x? |
I also had this issue and upgrading to 7.2.x fixed it, thanks! |
An
System.AccessViolationException
is raised when attempting to use$apply=aggregate
Assemblies affected
7.0.0-Nightly201801081323
Reproduce steps
$apply=groupby
or$apply=aggregate
, for examplehttp://localhost:5000/odata/Employees?$apply=groupby((SupervisorId),aggregate(Id with countdistinct as Total))
Expected result
Actual result
dotnet
process crashes. When debugging within Visual Studio on Windows, it appears the following exception is being raised:An unhandled exception of type 'System.AccessViolationException' occurred in Microsoft.AspNetCore.OData.dll Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Additional detail
More details can be found within dotnet/efcore#6132 (comment) and related to feature support of #1154
The text was updated successfully, but these errors were encountered: