[all-commits] [llvm/llvm-project] 8b062b: [scudo] Ensure proper allocator alignment in TSD test

Kostya Kortchinsky via All-commits all-commits at lists.llvm.org
Wed Jun 16 14:22:45 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8b062b61606270950645d73b68036c9ab2c7c4bc
      https://github.com/llvm/llvm-project/commit/8b062b61606270950645d73b68036c9ab2c7c4bc
  Author: Kostya Kortchinsky <kostyak at google.com>
  Date:   2021-06-16 (Wed, 16 Jun 2021)

  Changed paths:
    M compiler-rt/lib/scudo/standalone/primary32.h
    M compiler-rt/lib/scudo/standalone/primary64.h
    M compiler-rt/lib/scudo/standalone/quarantine.h
    M compiler-rt/lib/scudo/standalone/tests/tsd_test.cpp
    M compiler-rt/lib/scudo/standalone/tsd.h

  Log Message:
  -----------
  [scudo] Ensure proper allocator alignment in TSD test

The `MockAllocator` used in `ScudoTSDTest` wasn't allocated
properly aligned, which resulted in the `TSDs` of the shared
registry not being aligned either. This lead to some failures
like: https://reviews.llvm.org/D103119#2822008

This changes how the `MockAllocator` is allocated, same as
Vitaly did in the combined tests, properly aligning it, which
results in the `TSDs` being aligned as well.

Add a `DCHECK` in the shared registry to check that it is.

Differential Revision: https://reviews.llvm.org/D104402




More information about the All-commits mailing list