-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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.Security.VerificationException (type argument violates the constraint of type parameter) when running code on net 5.0 #45600
Comments
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. |
Tagging subscribers to this area: @bartonjs, @vcsjones, @krwq Issue DetailsDescriptionHi, we have encountered strange exception after one of ours project's target framework has been upgraded from netcoreapp3.1 to net5.0. This is the exception message:
I made simple console app to reproduce it:
If you run this code with target netcoreapp3.1 - it works. ConfigurationDotnet sdk 5.0.100 Regression?Yes, works on 3.1.
|
Hmm, |
Let me run the repro locally and see where the exception stems from in the native runtime. |
@janvorli Hi, is there any news? |
I have looked into it three weeks ago, but I wasn't able to figure out what's wrong right away and then got side tracked by other high priority work and Christmas holidays. It is still on my list to get to as soon as possible. |
I have debugged the problem and discovered a weird behavior in MethodDesc::SatisfiesMethodConstraints where it somehow incorrectly ends up checking |
cc: @mangod9 - I've thought the change was made by Michal, but I've just noticed it was your change. |
Thanks Jan, I will take a look. @GureevLeonid is this blocking your move to 5, or do you have a workaround for this? |
@mangod9 Yes, this issue is blocking us. |
I debugged the issue further and duplicate instantiation comes from here: runtime/src/coreclr/vm/siginfo.cpp Line 1427 in 3946369
With the following call stack. @MichalStrehovsky might need your help on this. Thx
|
I haven't done work in this part of the type system so I don't really know about it without setting up a repro and debugging through that. I think @davidwrighton would know more. This part of the CoreCLR type system is very different from the managed type system that I know more about. |
I'm taking a look today. Hopefully, I'll have something for the thread by EOD. |
I've come up with what appears to be a fix although I think it needs a bit more testing, and the test case needs some additional work. |
@GureevLeonid we would like permission to include code derived from your test case as a test in our testbed. May we do that? |
Yes, sure. |
…aint satisfaction (#47258) - The constraint processing logic in the runtime conflates the idea of constraint checking on open, closed over concrete types, and closed over non-concrete types - This change adds a tweak to avoid using an instantiation context that isn't related to the type variable being instantiated Fixes issue #45600 and adds a regression test from the customer.
Description
Hi, we have encountered strange exception after one of ours project's target framework has been upgraded from netcoreapp3.1 to net5.0.
This is the exception message:
I made simple console app to reproduce it:
If you run this code with target netcoreapp3.1 - it works.
But if you run with target netcoreapp5.0 - exception throws.
Configuration
Dotnet sdk 5.0.100
OS: MacOS Catalina (x64), Windows 10 1903 (x64)
Regression?
Yes, works on 3.1.
The text was updated successfully, but these errors were encountered: