Uh oh!
There was an error while loading. Please reload this page.
Do not check object references for equality after hot reload - #73009
Conversation
ghost
commented
Jul 28, 2022
Tagging subscribers to this area: @dotnet/area-system-reflection Issue DetailsRuntimeType member's cache is purged after hot reload, therefore same member references are not equal after hotreload which causing issue like mentioned in Hot Reload breaks MethodInfo equality Updated/added Object.Equals overloads to compare metadata token and module in case hot reload taken place instead of comparing object references. Fixes #69427
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
No, I could not understood why, a typical failure log looks like this: just know reverting back the Equals logic fixes those failures, will dig more |
buyaa-n
commented
Aug 4, 2022
Another log |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
jkotas
commented
Aug 5, 2022
Looking at the test failures - the reflected type needs to be also included in Equals method. |
- No need to use GetHashCodeOfPtr when we are wrapping the hashcode using HashCode.Combine that takes care of the randomization - Use underlying type handle for type hashcodes. It is faster than the default object hashcode. - Delete special casing for MetadataUpdater.IsSupported from RuntimeMethodInfo.GetHashCode. It is actually a de-optimization for RuntimeMethodInfo with the two changes above, and about neutral for the rest. - Avoid virtual call for ReflectedType comparison - Restore comment for RuntimeMethodInfo
@buyaa-n I have pushed a commit with a bunch of perf tweaks and simplifications. The commit description has the details. Let me know if it looks good to you or if you have any questions. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
buyaa-n
commented
Aug 6, 2022
Thanks for the description, makes sense to me |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
jkotas
commented
Aug 8, 2022
Looks good to me, modulo the last two comments |
buyaa-n
commented
Aug 8, 2022
Failures unrelated and known issue, merging |
RuntimeType member's cache is purged after hot reload, therefore same member references are not equal after hotreload which causing issue like mentioned in Hot Reload breaks MethodInfo equality
Updated/added Object.Equals overloads to compare metadata token and module in case hot reload taken place instead of comparing object references.
Fixes#69427