-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[release/8.0-staging] [mono] Fix GetCustomAttributes System.Reflection
API with a custom attribute provider
#94707
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
Conversation
Tagging subscribers to this area: @dotnet/area-system-reflection Issue DetailsBackport of #94602 to release/8.0-staging /cc @ivanpovazan Customer ImpactTestingRiskIMPORTANT: If this backport is for a servicing release, please verify that:
|
The added test has successfully passed on CI. This is safe to be merged. |
@ivanpovazan @lambdageek did this get Tactics approval? Today is code complete. |
I'm flowing staging to internal now, so the branches are closed. This will have to wait until the January release. |
Per tactics, this change unfortunately doesn't meet the bar in terms of customer impact. @ivanpovazan if you find this blocks customers in a significant way, please identify and reopen. |
@steveisok This affects the ASP.NET Core request handling on RHEL builds of .NET for ppc64le and s390x. |
I echo Tom's comments -- will be good to have it back ported to .NET 8 |
If you would like to see this backported, it needs to be justified by a concrete customer-centric statement. What is the concrete ASP.NET or Mobile scenario that is impacted by this issue? How likely is it for customers to hit the issue? Are there workarounds? ASP.NET test suite failing is not a good justification for a backport. It is why the backport was rejected by tactics. |
I think one possible (and simple) workaround would be to intercept calling the parameterless extension method public object[] GetCustomAttributes() => GetCustomAttributes(true); ExplanationIf we take one of the tests that were reported as crashing:
With the provided workaround we would intercept the step 2) and instead directly call the locally defined override https://github.com/dotnet/aspnetcore/blob/402e7fc10aa304775f50d318c8a4dafbf46dbfe0/src/Shared/PropertyAsParameterInfo.cs#L158 |
@ivanpovazan do you know if the test failures indicate product bugs? The backport request is closed assuming it will only address test failures and not actual product bugs. If we can demonstrate these are relevant product bugs, the decision to backport can be revisited. |
They indicate that using a custom attribute provider like: However, I am not sure how common such pattern is, as it would have been reported before. |
Backport of #94602 to release/8.0-staging
/cc @ivanpovazan
Customer Impact
ASP.NET test suite uses
GetCustomAttributes
API with a custom attribute provider: https://github.com/dotnet/aspnetcore/blob/402e7fc10aa304775f50d318c8a4dafbf46dbfe0/src/Shared/PropertyAsParameterInfo.cs#L15 which was not properly supported by Mono causing about 100 failing tests, as reported here: #94437 (comment)This affects customers using aspnetcore http request handling on platforms where Mono is the primary runtime flavor. This may also affect customers on mobile or WebAssembly.
This PR fixes the issue.
Testing
This PR includes a unit test which verifies the fix that should pass on CI.
Risk
Low.
IMPORTANT: If this backport is for a servicing release, please verify that:
The PR target branch is
release/X.0-staging
, notrelease/X.0
.If the change touches code that ships in a NuGet package, you have added the necessary package authoring and gotten it explicitly reviewed.