This is an archive of the discontinued LLVM Phabricator instance.

[scudo] Fix missing one block in range marking
ClosedPublic

Authored by Chia-hungDuan on May 4 2023, 9:30 AM.

Details

Summary

When a range contains only one block, we may not mark the pages touched
by the block as can-be-released. This happens in the last group and if
it only contains single block.

Also enhance the existing tests and add a new test for testing the last
block.

Diff Detail

Event Timeline

Chia-hungDuan created this revision.May 4 2023, 9:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 4 2023, 9:31 AM
Chia-hungDuan requested review of this revision.May 4 2023, 9:31 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 4 2023, 9:31 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
cferris requested changes to this revision.May 4 2023, 1:02 PM
cferris added inline comments.
compiler-rt/lib/scudo/standalone/release.h
552

Remove the at.

compiler-rt/lib/scudo/standalone/tests/release_test.cpp
475

Should this be a DCHECK? It seems like a check of an error condition that could be doing unnecessary work, so best to only do on a test build.

Although, if you want to leave it CHECK and change it to DCHECK later once the code has time to run on real systems, that sounds like a good plan.

571

contains a single block that will be

This revision now requires changes to proceed.May 4 2023, 1:02 PM
Chia-hungDuan marked 3 inline comments as done.

Address review comment

compiler-rt/lib/scudo/standalone/tests/release_test.cpp
475

Oops, this is a debug left over. Restored.

cferris accepted this revision.May 4 2023, 6:31 PM

LGTM

This revision is now accepted and ready to land.May 4 2023, 6:31 PM
This revision was automatically updated to reflect the committed changes.