Commit fe17c2c
authored
[mono][sgen] Make color visible to client permanent (#121247)
A color (SCC) that isn't containing any bridge objects is made visible
to client if xrefs_in * xrefs_out is greater than 60. Later on in bridge
processing, we need to build the callback to pass for .net android.
During this stage, we reduce from the full set of SCCs to SCCs that
should be visible to client (containing bridge objects or satisfying the
above condition). If an SCC has an xref to a color that is not visible
to client, we need to do a recursive traversal to find all neighbors
that are visible to client. The problem is that this process can end up
making an SCC no longer visible to client, leading to inconsistencies in
the computation. Consider a color(C1) that has a neighbor that is not
visible to client(C2). In this final stage, we compute the neighbors of
C1 by traversing recursively through the neighbors of C2. If C2 ends up
pointing to colors that were already neighbors of C1, then, following
this computation, C1 would end up with fewer xrefs_out, making the color
no longer visible to client. This make future checks incorrect,
resulting in building incorrect graph for client.
This scenario seems rare in practice, we should have gotten way more
reports otherwise. We fix this by pinning the visible_to_client property
for a color once it first satisfies it, so it will no longer matter how
many actual xrefs the color has.
Fixes assertions like:
```
* Assertion at /home/vbrezae/Xamarin/repos/runtime/src/mono/mono/metadata/sgen-tarjan-bridge.c:1151, condition `color_visible_to_client (cd)' not met
```1 parent 3345865 commit fe17c2c
File tree
3 files changed
+67
-8
lines changed- src
- coreclr/gc
- mono/mono/metadata
- tests/GC/Features/Bridge
3 files changed
+67
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
189 | 194 | | |
190 | 195 | | |
191 | 196 | | |
| |||
233 | 238 | | |
234 | 239 | | |
235 | 240 | | |
236 | | - | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
237 | 254 | | |
238 | 255 | | |
239 | 256 | | |
| |||
1186 | 1203 | | |
1187 | 1204 | | |
1188 | 1205 | | |
1189 | | - | |
1190 | | - | |
| 1206 | + | |
1191 | 1207 | | |
| 1208 | + | |
1192 | 1209 | | |
1193 | 1210 | | |
1194 | 1211 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
99 | 104 | | |
100 | 105 | | |
101 | 106 | | |
| |||
140 | 145 | | |
141 | 146 | | |
142 | 147 | | |
143 | | - | |
144 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
145 | 159 | | |
146 | 160 | | |
147 | 161 | | |
| |||
1105 | 1119 | | |
1106 | 1120 | | |
1107 | 1121 | | |
1108 | | - | |
1109 | | - | |
| 1122 | + | |
1110 | 1123 | | |
| 1124 | + | |
1111 | 1125 | | |
1112 | 1126 | | |
1113 | 1127 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
92 | 98 | | |
93 | 99 | | |
94 | 100 | | |
| |||
107 | 113 | | |
108 | 114 | | |
109 | 115 | | |
110 | | - | |
| 116 | + | |
111 | 117 | | |
112 | 118 | | |
113 | 119 | | |
| |||
403 | 409 | | |
404 | 410 | | |
405 | 411 | | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
406 | 433 | | |
407 | 434 | | |
408 | 435 | | |
| |||
417 | 444 | | |
418 | 445 | | |
419 | 446 | | |
| 447 | + | |
420 | 448 | | |
421 | 449 | | |
422 | 450 | | |
0 commit comments