[all-commits] [llvm/llvm-project] 5cfbfa: [sanitizer_common] Fix SanitizerCommon.ChainedOrig...
chbessonova via All-commits
all-commits at lists.llvm.org
Thu Jun 16 03:02:04 PDT 2022
Author: Kristina Bessonova <kbessonova at accesssoftek.com>
Date: 2022-06-16 (Thu, 16 Jun 2022)
[sanitizer_common] Fix SanitizerCommon.ChainedOriginDepotStats test
This test was failing with the following error message if to run the test binary
directly, w/o using lit:
$ Sanitizer-x86_64-Test --gtest_filter=SanitizerCommon.ChainedOriginDepot*
[ RUN ] SanitizerCommon.ChainedOriginDepotStats
Expected: (stats1.allocated) > (stats0.allocated), actual: 196608 vs 196608
[ FAILED ] SanitizerCommon.ChainedOriginDepotStats (867 ms)
Since the ChainedOriginDepot* tests are not doing any cleanup, by the time
SanitizerCommon.ChainedOriginDepotStats test starts executing the depot
may not be empty, so there will be no allocation for the test.
This patch introduces ChainedOriginDepot::TestOnlyUnmap() API that deallocates
memory when requested. This makes sure underlying TwoLevelMap initiates
the expected allocation during the test.
Reviewed By: eugenis
Differential Revision: https://reviews.llvm.org/D127621
More information about the All-commits