Skip to content

Invalid page size assumptions in GC #133743

Description

@jkotas

At very least, there seem to be an issue in GC as well:

Default 4MiB regions have 32KiB mark bitmaps, so adjacent regions share an OS page. 
Commit accounting double-counts that page, while decommit accounting fails to subtract it, causing the assertion.

With temporary  DOTNET_GCRegionSize=800000  (hexadecimal 8MiB), the full normal Checked CoreCLR suite completed

propsed fix:

size_t min_gc_region_size =
    OS_PAGE_SIZE * (mark_word_size / sizeof(uint32_t));

Originally posted by @EgorBo in #133675

Activity

  1. added
    untriaged
    on Sep 11, 2026
  2. dotnet-policy-service commented on Sep 11, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @anicka-net, @dotnet/gc
    See info in area-owners.md if you want to be subscribed.

  3. jkotas commented on Sep 11, 2026

    @jkotas
    MemberAuthor

    A few more findings from the same 64KiB-page machine, separate from the thunk and GC bitmap-accounting issues above:

    1. GC pre-OOM reclamation has another 4KiB assumption. move_aged_regions compares a region's committed size against GC_PAGE_SIZE (4096), whereas its initial commitment is an OS page. Under LLDB, a free region with 65536 committed bytes was skipped by this special pre-OOM reclamation path. This reproduces even with the 8MiB-region workaround. The comparison should use the actual initial commitment.
  4. self-assigned this
    on Sep 15, 2026
  5. added this to the 11.0.0 milestone on Sep 18, 2026
  6. removed
    untriaged
    on Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

  • Status
    No status

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions