This is an archive of the discontinued LLVM Phabricator instance.

[scudo][standalone] Fuchsia related fixes
ClosedPublic

Authored by cryptoad on Apr 14 2021, 9:21 PM.

Details

Summary

While attempting to roll the latest Scudo in Fuchsia, some issues
arose. While trying to debug them, it appeared that DCHECKs were
also never exercised in Fuchsia. This CL fixes the following
problems:

  • the size of a block in the TransferBatch class must be a multiple of the compact pointer scale. In some cases, it wasn't true, which lead to obscure crashes. Now, we round up sizeof(TransferBatch). This only materialized in Fuchsia due to the specific parameters of the DefaultConfig;
  • 2 DCHECK statements in Fuchsia were incorrect;
  • map() & co. require a size multiple of a page (as enforced in Fuchsia DCHECKs), which wasn't the case for PackedCounters.
  • In the Secondary, a parameter was marked as UNUSED while it is actually used.

Diff Detail

Event Timeline

cryptoad requested review of this revision.Apr 14 2021, 9:21 PM
cryptoad created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptApr 14 2021, 9:21 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
vitalybuka accepted this revision.Apr 14 2021, 9:56 PM
vitalybuka added inline comments.
compiler-rt/lib/scudo/standalone/release.h
83–96

maybe

This revision is now accepted and ready to land.Apr 14 2021, 9:56 PM
cryptoad added inline comments.Apr 15 2021, 8:59 AM
compiler-rt/lib/scudo/standalone/release.h
83–96

getBufferSize() is used in the tests and has to correlate to the size of the packed counters array, not the actual mapping size which can be larger.
If changing BufferSize here, the tests fail.

This revision was landed with ongoing or failed builds.Apr 15 2021, 1:27 PM
This revision was automatically updated to reflect the committed changes.