Uh oh!
There was an error while loading. Please reload this page.
Fix commit accounting for large pages - #78531
Conversation
ghost
commented
Nov 18, 2022
Tagging subscribers to this area: @dotnet/gc Issue DetailsThis change fixes an integer underflow that happens in the commit accounting, here is the sequence of events that will lead to it. Under Later, the Eventually, we This will result in a huge number, and that will fail future The fix simply makes sure we add the full region size to the
|
df7676d to
aec1429CompareUh oh!
There was an error while loading. Please reload this page.
aec1429 to
a86c1acComparecshung
commented
Nov 18, 2022
/backport to release/7.0 |
Started backporting to release/7.0: https://github.com/dotnet/runtime/actions/runs/3498854226 |
This change fixes an integer underflow that happens in the commit accounting, here is the sequence of events that will lead to it.
Under
use_large_page_p, we created a new heap segment, we passedSEGMENT_INITIAL_COMMIT(which is just a page) tovirtual_commit, socommitted_by_oh[0]is increased bySEGMENT_INITIAL_COMMIT.Later, the
heap_segment_committedvalue for the segment is changed tosize, which is the full region size.Eventually, we
return_free_region, which will subtractcommitted_by_oh[0]by the full region size, which will lead to a subtraction integer underflow.This will result in a huge number, and that will fail future
virtual_commitcalls, leading to unexpected OOM.The fix simply makes sure we add the full region size to the
committed_by_oh[0]to begin with.