Commit d31ff20
authored
Description:
This change puts HFA calculation in Crossgen2 in sync with native
CoreCLR runtime for value types with explicit layout. Previously
Crossgen2 had a shortcut in the routine deciding that structs with
explicit layouts are never marked as HFA that disagreed with
the CoreCLR runtime; consequently, on arm64, Crossgen2 disagreed
with the runtime on whether or not a function returning such a type
should allocate the stack slot for return value, basically
messing up the calling convention and GC refmap, resulting in various
random AVs and corruptions. This was first observed by an internal
customer in WPF apps where MilRectD is the type in question, later
JanK filed the issue 79327 for the same problem.
Customer impact:
Random runtime crashes on arm64.
Regression:
Nope, I believe the incomplete implementation was the original one,
this change just "improves it" by putting it in better sync with
the native runtime. I have also added a code comment mentioning
that these two need to be kept in sync.
Risk:
Low - the error in the previous implementation is obvious, R2RDump
and my new runtime diagnostics clearly show the GC refmap mismatch
caused by this problem and its fixing after applying the Crossgen2 fix.
Link to issue:
Link to PR against main:
Publishing impact:
In the particular case of the WPF app the problem was in
the PresentationCore.dll assembly. The assembly (or rather the entire WPF)
need to be recompiled with Crossgen2 with the fix applied for this to
take effect. For now I assume that is an automated part of the servicing
process.
Thanks
Tomas
1 parent 2cf9538 commit d31ff20
File tree
1 file changed
+39
-20
lines changed- src/coreclr/tools/Common/TypeSystem/Common
1 file changed
+39
-20
lines changedLines changed: 39 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
945 | 945 | | |
946 | 946 | | |
947 | 947 | | |
948 | | - | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
949 | 957 | | |
950 | 958 | | |
951 | 959 | | |
| |||
960 | 968 | | |
961 | 969 | | |
962 | 970 | | |
963 | | - | |
964 | | - | |
965 | | - | |
966 | | - | |
967 | | - | |
968 | | - | |
| 971 | + | |
969 | 972 | | |
970 | 973 | | |
971 | 974 | | |
| |||
978 | 981 | | |
979 | 982 | | |
980 | 983 | | |
| 984 | + | |
981 | 985 | | |
982 | 986 | | |
983 | 987 | | |
984 | 988 | | |
985 | 989 | | |
986 | 990 | | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
987 | 996 | | |
988 | 997 | | |
989 | 998 | | |
| |||
997 | 1006 | | |
998 | 1007 | | |
999 | 1008 | | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
1000 | 1018 | | |
1001 | 1019 | | |
1002 | 1020 | | |
| |||
1005 | 1023 | | |
1006 | 1024 | | |
1007 | 1025 | | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
1008 | 1031 | | |
1009 | 1032 | | |
1010 | | - | |
1011 | | - | |
| 1033 | + | |
| 1034 | + | |
1012 | 1035 | | |
1013 | 1036 | | |
1014 | | - | |
1015 | | - | |
1016 | | - | |
1017 | | - | |
1018 | | - | |
1019 | | - | |
1020 | | - | |
1021 | | - | |
1022 | | - | |
1023 | 1037 | | |
1024 | 1038 | | |
1025 | 1039 | | |
| |||
1028 | 1042 | | |
1029 | 1043 | | |
1030 | 1044 | | |
1031 | | - | |
1032 | | - | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
1033 | 1052 | | |
1034 | 1053 | | |
1035 | 1054 | | |
| |||
0 commit comments