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

System.Runtime.Serialization.Formatters.Tests.FormatterServicesTests.GetUninitializedObject_COMObject_ThrowsNotSupportedException fails with Mono #39704

Closed
ViktorHofer opened this issue Jul 21, 2020 · 14 comments · Fixed by #56806

Comments

@ViktorHofer
Copy link
Member

Configuration: net5.0-Windows_NT-Debug-x64-Mono_release-Windows.10.Amd64.Server19H1.ES.Open

The test wasn't running before because it was excluded via TargetsWindows even though the test project is runtime agnostic.

<Compile Include="FormatterServicesTests.Windows.cs" Condition="'$(TargetsWindows)' == 'true'" />

This was fixed with #35606 and started failing for Mono.

System.Runtime.Serialization.Formatters.Tests.FormatterServicesTests.GetUninitializedObject_COMObject_ThrowsNotSupportedException [FAIL]
        Assert.True() Failure
        Expected: True
        Actual:   False
        Stack Trace:
          C:\git\runtime4\src\libraries\System.Runtime.Serialization.Formatters\tests\FormatterServicesTests.Windows.cs(17,0): at System.Runtime.Serialization.Formatters.Tests.FormatterServicesTests.GetUninitializedObject_COMObject_ThrowsNotSupportedException()
          C:\git\runtime4\src\mono\netcore\System.Private.CoreLib\src\System\Reflection\RuntimeMethodInfo.cs(384,0): at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

cc @akoeplinger @lateralusX

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the untriaged New issue has not been triaged by the area owner label Jul 21, 2020
@Dotnet-GitSync-Bot
Copy link
Collaborator

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@akoeplinger
Copy link
Member

@lateralusX does this seem like something that should work on netcore-mono on Windows?

@lateralusX
Copy link
Member

lateralusX commented Aug 19, 2020

@akoeplinger

So we have disabled COM support on netcore (all platforms), this is from winconfig.h

#ifndef DISABLE_COM
#define DISABLE_COM 1
#endif

and the will result in:

#ifdef DISABLE_COM
#define mono_class_is_com_object(klass) (FALSE)
#else
#define mono_class_is_com_object(klass) (m_class_is_com_object (klass))
#endif

so IsCOMObject will always return FALSE on netcore mono runtime.

Since this is a Windows only test, it won't show up on other platforms, but the same implementation should apply.

We could include some more logic where we could make IsCOMObject working for just COMObject type and make sure the rest of this test pass as well (maybe Windows only). I did similar things to make sure "minimal" COM works on Windows (basically IUnknown) even when DISABLE_COM has been defined, we could include some more needed things for this scenario to pass even when DISABLE_COM has been defined. So questions is if its worth doing that change for combability reasons of Type.IsCOMObject on Windows only?

@marek-safar marek-safar removed the untriaged New issue has not been triaged by the area owner label Aug 24, 2020
@marek-safar marek-safar added this to the 6.0.0 milestone Aug 24, 2020
@marek-safar
Copy link
Contributor

The test will need adjustment for IsComSupported or something like that

@akoeplinger
Copy link
Member

@marek-safar do you think we should support COM on Mono on Windows?

@marek-safar
Copy link
Contributor

marek-safar commented Aug 24, 2020

@akoeplinger I'm not aware of any ask to support COM with MonoVM

@HongGit
Copy link
Contributor

HongGit commented Oct 22, 2020

@Benjie-Liu can you please work on this test issue?

@HongGit
Copy link
Contributor

HongGit commented Nov 4, 2020

@ViktorHofer is this still an issue for you?

@ViktorHofer
Copy link
Member Author

Has something changed since I filed the issue? I don't see any failures in the CI logs for the last 7 days but that doesn't mean that this isn't happening anymore.

@HongGit
Copy link
Contributor

HongGit commented Nov 4, 2020

Nothing has happened. However, we couldn't repro this issue. If this is not an issue anymore, we would like to close it out.

@akoeplinger
Copy link
Member

@HongGit you'll need to remove the ActiveIssue from the test which currently disables it:

[ActiveIssue("https://github.com/dotnet/runtime/issues/39704", TestRuntimes.Mono)]

After that I can still repro the issue with these steps which make sure you use the Mono runtime instead of CoreCLR:

build.cmd mono+libs
dotnet build /t:Test /p:RuntimeFlavor=mono src\libraries\System.Runtime.Serialization.Formatters\tests

@HongGit
Copy link
Contributor

HongGit commented Nov 4, 2020

After that I can still repro the issue with these steps which make sure you use the Mono runtime instead of CoreCLR

@Benjie-Liu ?

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Aug 3, 2021
@StephenMolloy
Copy link
Member

I looked at this one to help churn through burndown, and it seems pretty straighforward. No COM on Mono ==> Don't run the COM test on Mono. So I updated the test, created a PR, and then...

I thought to myself - I don't think we actually own Formatters. So... @GrabYourPitchforks? Here's a bug an a PR for quick review.

@ghost
Copy link

ghost commented Aug 4, 2021

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

Issue Details

Configuration: net5.0-Windows_NT-Debug-x64-Mono_release-Windows.10.Amd64.Server19H1.ES.Open

The test wasn't running before because it was excluded via TargetsWindows even though the test project is runtime agnostic.

<Compile Include="FormatterServicesTests.Windows.cs" Condition="'$(TargetsWindows)' == 'true'" />

This was fixed with #35606 and started failing for Mono.

System.Runtime.Serialization.Formatters.Tests.FormatterServicesTests.GetUninitializedObject_COMObject_ThrowsNotSupportedException [FAIL]
        Assert.True() Failure
        Expected: True
        Actual:   False
        Stack Trace:
          C:\git\runtime4\src\libraries\System.Runtime.Serialization.Formatters\tests\FormatterServicesTests.Windows.cs(17,0): at System.Runtime.Serialization.Formatters.Tests.FormatterServicesTests.GetUninitializedObject_COMObject_ThrowsNotSupportedException()
          C:\git\runtime4\src\mono\netcore\System.Private.CoreLib\src\System\Reflection\RuntimeMethodInfo.cs(384,0): at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

cc @akoeplinger @lateralusX

Author: ViktorHofer
Assignees: -
Labels:

area-Serialization, area-System.Runtime, in pr

Milestone: 6.0.0

@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Aug 5, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Sep 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants