runtime: Bug: incorrect parameters passed only in release build linux-x64
On a specific project the release build is passing incorrect parameters under linux-x64.
Platform: Linux x64. I tested on Debian GNU/Linux 9 (stretch) and Red Hat Enterprise Linux Server release 7.5 (Maipo).
Steps to replicate:
- Install .Net Core 2.2 on linux
- Use this project: https://github.com/abelykh0/NetCoreIssue
- Open the solution LinuxNetCoreBug.sln in Visual Studio 2017
- Right click on Publish project, Publish, then choose “Release linux-x64”. Change the folder if needed (it is currently set to C:\Projects\Issue). Click Publish
- Run dotnet exec LinuxNetCoreBug.dll on linux
Here is the implementation of the abstract method (the implementation is in the LoadedLibrary
assembly, which is loaded dynamically with Assembly.LoadFrom
by the main program):
protected override IList<Guid> DbFileSystemQuery(
int pageNumber,
int pageSize,
ICollection<Guid> queryTargetId,
FileSystemQueryOptions queryOptions,
IList<Tuple<FileSystemQueryField, SortDirection>> orderBy,
ICollection<FileSystemQueryFilterRule> filter)
{
Console.WriteLine(orderBy.GetType().ToString());
Console.WriteLine(filter.GetType().ToString());
Console.WriteLine(orderBy == filter);
return null;
}
Actual result (on linux x64):
CoreLibrary.FileSystemQueryFilterRule[] CoreLibrary.FileSystemQueryFilterRule[] True
This output shows that the orderBy
and filter
parameters are the same object. However, this should be impossible because the types don’t even work out.
Expected result (works in debug build or in debug or release build in Windows):
System.Tuple`2[CoreLibrary.FileSystemQueryField,CoreLibrary.SortDirection][] CoreLibrary.FileSystemQueryFilterRule[] False
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 3
- Comments: 30 (21 by maintainers)
What are the chances this fix will make it into some future 2.2 update?
Sorry, I edited the comment. Actually, enabling tiered compilation fixes it. If it is disabled, the issue occurs. The reason it is working on 3.0.0 preview is that the default changed from 0 to 1. If I set COMPlus_TieredCompilation=0, it also fails in 3.0.0.