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

Constructor_String_LoadVersionTest failing on Fedora runs #27817

Open
weshaggard opened this issue Nov 5, 2018 · 5 comments
Open

Constructor_String_LoadVersionTest failing on Fedora runs #27817

weshaggard opened this issue Nov 5, 2018 · 5 comments
Labels
area-System.Reflection disabled-test The test is disabled in source code against the issue help wanted [up-for-grabs] Good issue for external contributors investigate os-linux Linux OS (any supported distro)
Milestone

Comments

@weshaggard
Copy link
Member

Assert.Throws() Failure
Expected: typeof(System.IO.FileNotFoundException)
Actual:   (No exception was thrown)
Stack Trace :
   at System.Reflection.Tests.AssemblyNameTests.Constructor_String_LoadVersionTest() in /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Release+AGroup_x64+TestOuter_false_prtest/src/System.Reflection/tests/AssemblyNameTests.cs:line 559

A couple examples:
https://mc.dot.net/#/user/weshaggard/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/84cf25a2c8d2bd2819584e57de87a5c1c0fa6efa/workItem/System.Reflection.Tests/analysis/xunit/System.Reflection.Tests.AssemblyNameTests~2FConstructor_String_LoadVersionTest
https://mc.dot.net/#/user/stephentoub/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/b4be508ae9f11a42286a828728d537eca987d0bb/workItem/System.Reflection.Tests/analysis/xunit/System.Reflection.Tests.AssemblyNameTests~2FConstructor_String_LoadVersionTest

stephentoub referenced this issue in dotnet/corefx Nov 5, 2018
* Remove duplcated test assemblies from System.Runtime

As part of #33101 these
assemblies were moved under System.Reflection but weren't
deleted from System.Runtime so this work finishes up the move.

* Disable Constructor_String_LoadVersionTest test

Filed https://github.com/dotnet/corefx/issues/33249 to track it.
@steveharter
Copy link
Member

Also occurred on

Windows.10.Amd64.Core-x64 
Release
RedHat.73.Amd64-x64 
Release

@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the Future milestone Jan 31, 2020
@steveharter steveharter modified the milestones: Future, 5.0 Feb 11, 2020
@maryamariyan maryamariyan added the untriaged New issue has not been triaged by the area owner label Feb 23, 2020
@steveharter steveharter removed the untriaged New issue has not been triaged by the area owner label Mar 6, 2020
@steveharter
Copy link
Member

Note the failing test is marked with [ActiveIssue]

@steveharter
Copy link
Member

steveharter commented Aug 11, 2020

This test is not working on Windows either, it is throwing FileLoadException not FileNotFoundException.

This test is not valid for coreclr. It assumes the binding semantics of assemblyname that only exist in NetFx, not CoreFx.

The CoreFx binding\loader (core-setup) has the rough algorithm:

  • During bootstrapping of the native dotnet executable, it obtains version information from the .deps.json file, not the assemblyname from the assembly manifest. This is used to support roll-forward only (major\minor\patch depending on settings).
  • Passes the list of assemblies (names, not including version) to the CoreClr when initializing the CoreClr.
  • When assembly is loaded, the CLR verifies the reference's assembly name is compatible with the target assembly's version (from the assembly manifest). The versions match exactly except for patch\build version.

At a minimum this test should catch FileLoadException not FileNotFoundException (at least to match current Core semantics). The file exists, just the assembly manifest version is not compatible.

@steveharter
Copy link
Member

In CI, sometimes FileLoadException is thrown, but mostly FileNotFoundException is thrown.

In a local build (Windows x64), FileLoadException is always thrown. It is thrown because:

  • IsCompatibleAssemblyVersion fails due to the AssemblyName version not equal to the manifest version.
  • hr = FUSION_E_REF_DEF_MISMATCH is returned and a EEFileLoadException::Throw is performed.
  • There is a subsequent check in a catch (PostBindResolveAssembly) but that just re-throws the same exception.

In a local console app, FileNotFoundException is always thrown for the same scenario.

I believe XUnit is interfering in some manner, and that the run-time semantics are consistent.

More debugging is necessary.

@steveharter
Copy link
Member

Moving to Future; bug (likely test) also occurred in 3.1.

@steveharter steveharter modified the milestones: 5.0.0, Future Aug 11, 2020
@steveharter steveharter removed their assignment Jan 19, 2021
@steveharter steveharter added investigate help wanted [up-for-grabs] Good issue for external contributors labels Oct 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Reflection disabled-test The test is disabled in source code against the issue help wanted [up-for-grabs] Good issue for external contributors investigate os-linux Linux OS (any supported distro)
Projects
No open projects
Development

No branches or pull requests

4 participants