[all-commits] [llvm/llvm-project] 0d3d4d: [scudo][standalone] Make tests work on Fuchsia

Kostya Kortchinsky via All-commits all-commits at lists.llvm.org
Wed Nov 27 09:43:02 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 0d3d4d3b0fc57e577a8f80261bd4390c6cb7c040
      https://github.com/llvm/llvm-project/commit/0d3d4d3b0fc57e577a8f80261bd4390c6cb7c040
  Author: Kostya Kortchinsky <kostyak at google.com>
  Date:   2019-11-27 (Wed, 27 Nov 2019)

  Changed paths:
    M compiler-rt/lib/scudo/standalone/allocator_config.h
    M compiler-rt/lib/scudo/standalone/secondary.h
    M compiler-rt/lib/scudo/standalone/tests/atomic_test.cpp
    M compiler-rt/lib/scudo/standalone/tests/bytemap_test.cpp
    M compiler-rt/lib/scudo/standalone/tests/checksum_test.cpp
    M compiler-rt/lib/scudo/standalone/tests/chunk_test.cpp
    M compiler-rt/lib/scudo/standalone/tests/combined_test.cpp
    M compiler-rt/lib/scudo/standalone/tests/flags_test.cpp
    M compiler-rt/lib/scudo/standalone/tests/list_test.cpp
    M compiler-rt/lib/scudo/standalone/tests/map_test.cpp
    M compiler-rt/lib/scudo/standalone/tests/mutex_test.cpp
    M compiler-rt/lib/scudo/standalone/tests/primary_test.cpp
    M compiler-rt/lib/scudo/standalone/tests/quarantine_test.cpp
    M compiler-rt/lib/scudo/standalone/tests/release_test.cpp
    M compiler-rt/lib/scudo/standalone/tests/report_test.cpp
    A compiler-rt/lib/scudo/standalone/tests/scudo_unit_test.h
    M compiler-rt/lib/scudo/standalone/tests/scudo_unit_test_main.cpp
    M compiler-rt/lib/scudo/standalone/tests/secondary_test.cpp
    M compiler-rt/lib/scudo/standalone/tests/size_class_map_test.cpp
    M compiler-rt/lib/scudo/standalone/tests/stats_test.cpp
    M compiler-rt/lib/scudo/standalone/tests/strings_test.cpp
    M compiler-rt/lib/scudo/standalone/tests/tsd_test.cpp
    M compiler-rt/lib/scudo/standalone/tests/vector_test.cpp
    M compiler-rt/lib/scudo/standalone/tests/wrappers_c_test.cpp
    M compiler-rt/lib/scudo/standalone/tests/wrappers_cpp_test.cpp

  Log Message:
  -----------
  [scudo][standalone] Make tests work on Fuchsia

Summary:
This CL makes unit tests compatible with Fuchsia's zxtest. This
required a few changes here and there, but also unearthed some
incompatibilities that had to be addressed.

A header is introduced to allow to account for the zxtest/gtest
differences, some `#if SCUDO_FUCHSIA` are used to disable incompatible
code (the 32-bit primary, or the exclusive TSD).

It also brought to my attention that I was using
`__scudo_default_options` in different tests, which ended up in a
single binary, and I am not sure how that ever worked. So move
this to the main cpp.

Additionally fully disable the secondary freelist on Fuchsia as we do
not track VMOs for secondary allocations, so no release possible.

With some modifications to Scudo's BUILD.gn in Fuchsia:
```
[==========] 79 tests from 23 test cases ran (10280 ms total).
[  PASSED  ] 79 tests
```

Reviewers: mcgrathr, phosek, hctim, pcc, eugenis, cferris

Subscribers: srhines, jfb, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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




More information about the All-commits mailing list