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

[.NET 6] Linker may not preserve exported methods with overrides #11449

Closed
Tracked by #43078
sbomer opened this issue May 5, 2021 · 2 comments
Closed
Tracked by #43078

[.NET 6] Linker may not preserve exported methods with overrides #11449

sbomer opened this issue May 5, 2021 · 2 comments
Labels
dotnet An issue or pull request related to .NET (6) dotnet-pri0 .NET 6: required for stable release
Milestone

Comments

@sbomer
Copy link
Member

sbomer commented May 5, 2021

This check for overrides happens before MarkStep, when the linker has not built type hierarchy info. Even when this changes to run during MarkStep with #11374, there is no guarantee that the override info will be complete, so it will likely neglect to preserve some exported methods that have overrides which aren't discovered yet.

https://github.com/xamarin/xamarin-macios/blob/50b68d4aab0a1099113a68c04aad5a77592b6e52/tools/linker/MarkNSObjects.cs#L84-L91

It seems like this could be changed to walk up the type hierarchy instead (though this would require looking at base methods for many unannotated methods), or it could be cached as part of some custom type map logic that pre-loads assemblies as mentioned in #11447. (I am filing this as a separate issue because it seems like a correctness concern, not just a perf optimization).

@spouliot spouliot added dotnet An issue or pull request related to .NET (6) dotnet-pri1 .NET 6: important for stable release labels May 5, 2021
@spouliot spouliot added this to the .NET 6 milestone May 5, 2021
@spouliot spouliot added dotnet-pri0 .NET 6: required for stable release and removed dotnet-pri1 .NET 6: important for stable release labels May 10, 2021
@spouliot
Copy link
Contributor

iirc that has been fixed a while ago, at least since 045ccaf
@sbomer what there anything missing ?

@sbomer
Copy link
Member Author

sbomer commented Aug 10, 2021

Yup, this was fixed in that change. CoreTypeMapStep now builds the type hierarchy info before this override check.

@sbomer sbomer closed this as completed Aug 10, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dotnet An issue or pull request related to .NET (6) dotnet-pri0 .NET 6: required for stable release
Projects
None yet
Development

No branches or pull requests

2 participants