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

[Mono] Several tests fail in AssemblyLoadContext.InternalLoadFromPath #34030

Closed
MaximLipnin opened this issue Mar 24, 2020 · 5 comments · Fixed by #57210
Closed

[Mono] Several tests fail in AssemblyLoadContext.InternalLoadFromPath #34030

MaximLipnin opened this issue Mar 24, 2020 · 5 comments · Fixed by #57210
Labels
arch-wasm WebAssembly architecture area-AssemblyLoader-mono os-linux Linux OS (any supported distro) runtime-mono specific to the Mono runtime
Milestone

Comments

@MaximLipnin
Copy link
Contributor

The following tests are disabled in Mono's CoreFX.issues_linux.rsp file, and they fail after being enabled (at least on Ubuntu 18.04):

  • System.Tests.ActivatorTests.TestingCreateInstanceFromObjectHandleFullSignature
  • System.Tests.ActivatorTests.TestingCreateInstanceFromObjectHandle
  • System.Tests.AppDomainTests.TestingCreateInstanceFromObjectHandleFullSignature
  • System.Tests.AppDomainTests.TestingCreateInstanceFromObjectHandle

The example of failure:

System.Tests.ActivatorTests.TestingCreateInstanceFromObjectHandle(physicalFileName: "TestLoadAssembly.dll", assemblyFile: "testloadassembly.dll", type: "publicclassnodefaultconstructorsample", returnedFullNameType: "PublicClassNoDefaultConstructorSample", exceptionType: typeof(System.TypeLoadException)) [FAIL]
Assert.Throws() Failure
Expected: typeof(System.TypeLoadException)
Actual:   typeof(System.IO.FileNotFoundException): Could not load file or assembly '/home/maxim/Desktop/runtime/artifacts/bin/System.Runtime.Tests/netcoreapp5.0-Unix-Release/testloadassembly.dll' or one of its dependencies.
---- System.IO.FileNotFoundException : Could not load file or assembly '/home/maxim/Desktop/runtime/artifacts/bin/System.Runtime.Tests/netcoreapp5.0-Unix-Release/testloadassembly.dll' or one of its dependencies.
Stack Trace:
    /home/maxim/Desktop/runtime/src/mono/netcore/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyLoadContext.Mono.cs(37,0): at System.Runtime.Loader.AssemblyLoadContext.InternalLoadFromPath(String assemblyPath, String nativeImagePath)
    /home/maxim/Desktop/runtime/src/libraries/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyLoadContext.cs(309,0): at System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyPath(String assemblyPath)
    /home/maxim/Desktop/runtime/src/libraries/System.Private.CoreLib/src/System/Reflection/Assembly.cs(335,0): at System.Reflection.Assembly.LoadFrom(String assemblyFile)
    /home/maxim/Desktop/runtime/src/libraries/System.Private.CoreLib/src/System/Activator.cs(51,0): at System.Activator.CreateInstanceFrom(String assemblyFile, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
    /home/maxim/Desktop/runtime/src/libraries/System.Private.CoreLib/src/System/Activator.cs(44,0): at System.Activator.CreateInstanceFrom(String assemblyFile, String typeName)
    /home/maxim/Desktop/runtime/src/libraries/System.Runtime/tests/System/ActivatorTests.cs(630,0): at System.Tests.ActivatorTests.<>c__DisplayClass63_0.<TestingCreateInstanceFromObjectHandle>b__0()
    ----- Inner Stack Trace -----
    /home/maxim/Desktop/runtime/src/mono/netcore/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyLoadContext.Mono.cs(37,0): at System.Runtime.Loader.AssemblyLoadContext.InternalLoadFromPath(String assemblyPath, String nativeImagePath)
    /home/maxim/Desktop/runtime/src/libraries/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyLoadContext.cs(309,0): at System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyPath(String assemblyPath)
    /home/maxim/Desktop/runtime/src/libraries/System.Private.CoreLib/src/System/Reflection/Assembly.cs(335,0): at System.Reflection.Assembly.LoadFrom(String assemblyFile)
    /home/maxim/Desktop/runtime/src/libraries/System.Private.CoreLib/src/System/Activator.cs(51,0): at System.Activator.CreateInstanceFrom(String assemblyFile, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
    /home/maxim/Desktop/runtime/src/libraries/System.Private.CoreLib/src/System/Activator.cs(44,0): at System.Activator.CreateInstanceFrom(String assemblyFile, String typeName)
    /home/maxim/Desktop/runtime/src/libraries/System.Runtime/tests/System/ActivatorTests.cs(630,0): at System.Tests.ActivatorTests.<>c__DisplayClass63_0.<TestingCreateInstanceFromObjectHandle>b__0()

These tests will be marked with ActiveIssue in #33953

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-System.Runtime untriaged New issue has not been triaged by the area owner labels Mar 24, 2020
@ghost
Copy link

ghost commented Apr 10, 2020

Tagging @CoffeeFlux as an area owner

@danmoseley
Copy link
Member

mono_error_set_simple_file_not_found (error, filename, asmctx == MONO_ASMCTX_REFONLY);

@danmoseley
Copy link
Member

similar to #34492

I'm assuming we follow CoreCLR

@CoffeeFlux CoffeeFlux self-assigned this Apr 10, 2020
@danmoseley danmoseley added the os-linux Linux OS (any supported distro) label Apr 15, 2020
@CoffeeFlux
Copy link
Contributor

This is also blocking AppDomainTests.AssemblyResolve_FirstChanceException.

monojenkins pushed a commit to monojenkins/mono that referenced this issue Jun 1, 2020
…netcore

Fixes mono#16246

Contributes to mono#14788

The commits here should be reasonably chunked up, but a summary of what this accomplishes:

* Wires up OnResourceResolve
* Fixes our corlib satellite assembly check in netcore_load_reference (we were previously comparing "System.Private.Corelib" to "System.Private.Corelib.resources", which does not work)
* Adds some useful classes to mono_defaults
* Removes legacy events from MonoDomain and prevents calling them on netcore
* Fixes UnhandledException to call the correct event
* Wires up FirstChanceException

`AppDomainTests.AssemblyResolve_FirstChanceException` is now failing because of the exception type, so it should work once I sort out dotnet/runtime#34030. Until then, keep it disabled.
CoffeeFlux added a commit to mono/mono that referenced this issue Jun 8, 2020
…netcore (#19799)

Fixes #16246

Contributes to #14788

The commits here should be reasonably chunked up, but a summary of what this accomplishes:

* Wires up OnResourceResolve
* Fixes our corlib satellite assembly check in netcore_load_reference (we were previously comparing "System.Private.Corelib" to "System.Private.Corelib.resources", which does not work)
* Adds some useful classes to mono_defaults
* Removes legacy events from MonoDomain and prevents calling them on netcore
* Fixes UnhandledException to call the correct event
* Wires up FirstChanceException

`AppDomainTests.AssemblyResolve_FirstChanceException` is now failing because of the exception type, so it should work once I sort out dotnet/runtime#34030. Until then, keep it disabled.

Co-authored-by: CoffeeFlux <[email protected]>
@lambdageek lambdageek added this to the 5.0.0 milestone Jun 22, 2020
@lambdageek lambdageek removed the untriaged New issue has not been triaged by the area owner label Jun 22, 2020
@CoffeeFlux CoffeeFlux modified the milestones: 5.0.0, 6.0.0 Jun 30, 2020
@safern safern added the arch-wasm WebAssembly architecture label Jul 15, 2020
@safern
Copy link
Member

safern commented Jul 15, 2020

This also fails on Browser.

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Aug 12, 2021
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Aug 14, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Sep 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-AssemblyLoader-mono os-linux Linux OS (any supported distro) runtime-mono specific to the Mono runtime
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants