Commit 9214958
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:
#79327
Link to PR against main:
#80218
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 c03b845 commit 9214958
File tree
1 file changed
+39
-23
lines changed- src/coreclr/tools/Common/TypeSystem/Common
1 file changed
+39
-23
lines changedLines changed: 39 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
920 | 920 | | |
921 | 921 | | |
922 | 922 | | |
923 | | - | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
924 | 932 | | |
925 | 933 | | |
926 | 934 | | |
| |||
931 | 939 | | |
932 | 940 | | |
933 | 941 | | |
934 | | - | |
935 | | - | |
936 | | - | |
937 | 942 | | |
938 | | - | |
939 | | - | |
940 | | - | |
941 | | - | |
942 | | - | |
943 | | - | |
| 943 | + | |
944 | 944 | | |
945 | 945 | | |
946 | 946 | | |
| |||
953 | 953 | | |
954 | 954 | | |
955 | 955 | | |
| 956 | + | |
956 | 957 | | |
957 | 958 | | |
958 | 959 | | |
959 | 960 | | |
960 | 961 | | |
961 | 962 | | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
962 | 968 | | |
963 | 969 | | |
964 | 970 | | |
| |||
972 | 978 | | |
973 | 979 | | |
974 | 980 | | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
975 | 990 | | |
976 | 991 | | |
977 | 992 | | |
| |||
980 | 995 | | |
981 | 996 | | |
982 | 997 | | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
983 | 1003 | | |
984 | 1004 | | |
985 | | - | |
986 | | - | |
| 1005 | + | |
| 1006 | + | |
987 | 1007 | | |
988 | 1008 | | |
989 | | - | |
990 | | - | |
991 | | - | |
992 | | - | |
993 | | - | |
994 | | - | |
995 | | - | |
996 | | - | |
997 | | - | |
998 | 1009 | | |
999 | 1010 | | |
1000 | 1011 | | |
| |||
1003 | 1014 | | |
1004 | 1015 | | |
1005 | 1016 | | |
1006 | | - | |
1007 | | - | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
1008 | 1024 | | |
1009 | 1025 | | |
1010 | 1026 | | |
| |||
0 commit comments