Commit 86e5612
Fix segfault in GC standalone large pages emulation mode (segments path)
In the non-regions (segments) path used by standalone GC (clrgc.dll),
GCLargePages=2 (emulation mode) sets use_large_pages_p=true but reserves
memory with normal pages without committing. This causes two problems:
1. virtual_commit (memory.cpp:102) returns true without actually committing
for large pages heap memory, so accessing the memory causes a segfault.
Fix: commit all reserved blocks upfront in init.cpp for emulation mode,
matching the regions path behavior (init.cpp lines 895-901).
2. make_heap_segment calls virtual_commit for accounting, which hits the
hard limit check. With large pages, segment sizes fill the entire hard
limit budget (soh+loh+poh = heap_hard_limit), leaving zero room for
infrastructure commits (card tables, mark lists). The hard limit check
rejects and initialization fails.
Fix: in make_heap_segment for large pages + non-regions, bypass
virtual_commit (memory is already committed) but manually update the
committed bytes accounting so diagnostics verification stays consistent.
Fixes #1276681 parent f1ca590 commit 86e5612
2 files changed
Lines changed: 41 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
923 | 923 | | |
924 | 924 | | |
925 | 925 | | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
926 | 942 | | |
927 | 943 | | |
928 | 944 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1313 | 1313 | | |
1314 | 1314 | | |
1315 | 1315 | | |
1316 | | - | |
| 1316 | + | |
| 1317 | + | |
1317 | 1318 | | |
1318 | | - | |
1319 | | - | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
1320 | 1342 | | |
1321 | 1343 | | |
1322 | 1344 | | |
| |||
0 commit comments