Repository navigation
Conversation
wks
reviewed
Nov 4, 2026
| "Attempt to grow FreeList beyond limit" | ||
| ); | ||
| if self.high_water + grow_extent > self.limit { | ||
| grow_extent = self.high_water - self.limit; |
Collaborator
There was a problem hiding this comment.
It looks like the code in the Rust MMTk core is ported from this piece of code in JikesRVM:
/**
* Raise the high water mark by requesting more pages from the OS
*
* @param blocks block count to raise by
*/
private void raiseHighWater(int blocks) {
Extent growExtent = Conversions.pagesToBytes(pagesPerBlock * blocks);
if (highWater.EQ(limit)) {
Log.write("limit=", limit);
Log.write(", highWater=", highWater);
Log.writeln(", growExtent=", growExtent);
VM.assertions.fail("Attempt to grow FreeList beyond limit");
}
if (highWater.plus(growExtent).GT(limit)) {
growExtent = highWater.diff(limit).toWord().toExtent();
}
mmap(highWater, growExtent);
highWater = highWater.plus(growExtent);
}highWater.diff(limit) means highWater - limit. The highWater should not be higher than than limit, and the result of the diff shall be negative. It is a bug in JikesRVM, and I am surprised it has existed since 2016 and never gets found.
Collaborator
|
Looks like this PR and #1625 are both trying to fix the same issue? Or at least very similar issues |
Member
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Growing a RawMemoryFreeList up to its limit panics.
raise_high_watersubtracted the wrong way round when clamping to the limit, andcurrent_capacityignored the last block when the limit cut it short. Easy to hit with a small fixed heap, e.g. 24 MB.