You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
A few more findings from the same 64KiB-page machine, separate from the thunk and GC bitmap-accounting issues above:
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.
Empty memory-mapped views leak one OS-page mapping on Unix.CreateView maps one byte for an empty view but records a native length of zero. Disposal then calls munmap(address, 0), which fails. Reproduced against the locally built libraries: all 32 disposed empty views remained mapped. This isn't exclusive to 64KiB pages, but the leaked virtual mapping is 64KiB per view here, rather than 4KiB.
Potential loss of file-backed loading for bundled ReadyToRun assemblies. The bundler uses 4KiB alignment on ARM64, while PAL's header mapping and section-overlap check can reject an image at a non-64KiB-aligned bundle offset on this host. That can lead to a Checked assertion or a Release fallback to a private image copy. This is a source-analysis finding; the skewed single-file case still needs an end-to-end repro.
I validated the fix. I did it by creating a separate reproducer for the issue because my source-built .NET 11 SDK seem to be taking a different execution path which doesn't crash. With the reproducer, the issue also occurred on the source-built SDK. With @EgorBo's patch, it no longer does.
Activity
dotnet-policy-service commentedon Sep 11, 2026
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.
EgorBo commentedon Sep 11, 2026
https://github.com/dotnet/runtime/blob/main/src/coreclr/nativeaot/Runtime/ThunksMapping.cpp#L218
Looks like this instruction assumes it can encode page size into the reloc imm, which is not true for 64kb
This seems to fix it (tested on a linux-arm64 ubuntu with 64kb page, see PAGESIZE on the screen).
Leaving it for VM people to confirm/investigate other places if any since apparently we don't test 64kb pages on CI and there might be more places.
EgorBo commentedon Sep 11, 2026
At very least, there seem to be an issue in GC as well:
propsed fix:
EgorBo commentedon Sep 11, 2026
A few more findings from the same 64KiB-page machine, separate from the thunk and GC bitmap-accounting issues above:
GC pre-OOM reclamation has another 4KiB assumption.
move_aged_regionscompares a region's committed size againstGC_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.Empty memory-mapped views leak one OS-page mapping on Unix.
CreateViewmaps one byte for an empty view but records a native length of zero. Disposal then callsmunmap(address, 0), which fails. Reproduced against the locally built libraries: all 32 disposed empty views remained mapped. This isn't exclusive to 64KiB pages, but the leaked virtual mapping is 64KiB per view here, rather than 4KiB.Potential loss of file-backed loading for bundled ReadyToRun assemblies. The bundler uses 4KiB alignment on ARM64, while PAL's header mapping and section-overlap check can reject an image at a non-64KiB-aligned bundle offset on this host. That can lead to a Checked assertion or a Release fallback to a private image copy. This is a source-analysis finding; the skewed single-file case still needs an end-to-end repro.
JulieLeeMSFT commentedon Sep 11, 2026
@kkokosa, @agocke, PTAL.
dotnet-policy-service commentedon Sep 11, 2026
Tagging subscribers to this area: @agocke
See info in area-owners.md if you want to be subscribed.
4 remaining items
jkotas commentedon Sep 11, 2026
@tmds Can you validate that the fix proposed by @EgorBo above fixes the problem?
dotnet-policy-service commentedon Sep 11, 2026
Tagging subscribers to this area: @agocke, @dotnet/ilc-contrib
See info in area-owners.md if you want to be subscribed.
tmds commentedon Sep 14, 2026
I will try to do it today.
tmds commentedon Sep 14, 2026
I validated the fix. I did it by creating a separate reproducer for the issue because my source-built .NET 11 SDK seem to be taking a different execution path which doesn't crash. With the reproducer, the issue also occurred on the source-built SDK. With @EgorBo's patch, it no longer does.
Thanks @EgorBo!
Copy-pastable patch (for anyone that wants it):
tmds commentedon Sep 15, 2026
Could such a config be added to the CI?
jkotas commentedon Sep 15, 2026
Opened #133944
Fix .NET 11 rc1 SDK crash on RHEL8 arm64 (#133887)
Fix .NET 11 rc1 SDK crash on RHEL8 arm64 (dotnet#133887)