| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 1 年前 | ||
[scudo] Refactor allocator config to support optional flags (#81805) Instead of explicitly disabling a feature by declaring the variable and set it to false, this change supports the optional flags. I.e., you can skip certain flags if you are not using it. This optional feature supports both forms, 1. Value: A parameter for a feature. E.g., EnableRandomOffset 2. Type: A C++ type implementing a feature. E.g., ConditionVariableT On the other hand, to access the flags will be through one of the wrappers, BaseConfig/PrimaryConfig/SecondaryConfig/CacheConfig (CacheConfig is embedded in SecondaryConfig). These wrappers have the getters to access the value and the type. When adding a new feature, we need to add it to allocator_config.def and mark the new variable with either *_REQUIRED_* or *_OPTIONAL_* macro so that the accessor will be generated properly. In addition, also remove the need of UseConditionVariable to flip on/off of condition variable. Now we only need to define the type of condition variable. | 2 年前 | |
[scudo][standalone] Remove unused atomic_compare_exchange_weak atomic_compare_exchange_weak is unused in Scudo, and its associated test is actually wrong since the weak variant is allowed to fail spuriously (thanks Roland). This lead to flakes such as: [ RUN ] ScudoAtomicTest.AtomicCompareExchangeTest ../../zircon/third_party/scudo/src/tests/atomic_test.cpp:98: Failure: Expected atomic_compare_exchange_weak(reinterpret_cast<T *>(&V), &OldVal, NewVal, memory_order_relaxed) is true. Expected: true Which is: 01 Actual : atomic_compare_exchange_weak(reinterpret_cast<T *>(&V), &OldVal, NewVal, memory_order_relaxed) Which is: 00 ../../zircon/third_party/scudo/src/tests/atomic_test.cpp:100: Failure: Expected atomic_compare_exchange_weak( reinterpret_cast<T *>(&V), &OldVal, NewVal, memory_order_relaxed) is false. Expected: false Which is: 00 Actual : atomic_compare_exchange_weak( reinterpret_cast<T *>(&V), &OldVal, NewVal, memory_order_relaxed) Which is: 01 ../../zircon/third_party/scudo/src/tests/atomic_test.cpp:101: Failure: Expected OldVal == NewVal. Expected: NewVal Which is: 24 Actual : OldVal Which is: 42 [ FAILED ] ScudoAtomicTest.AtomicCompareExchangeTest (0 ms) [----------] 2 tests from ScudoAtomicTest (1 ms total) So I am removing this, if someone ever needs the weak variant, feel free to add it back with a test that is not as terrible. This test was initially ported from sanitizer_common, but their weak version calls the strong version, so it works for them. Differential Revision: https://reviews.llvm.org/D88443 | 5 年前 | |
scudo: Delete unused class ScudoByteMap. NFCI. The class is only used in SizeClassAllocator32 in 64-bit mode, but we don't use that class in 64-bit mode. Differential Revision: https://reviews.llvm.org/D74099 | 6 年前 | |
[scudo] Fix static and unused function type annotations Differential Revision: https://reviews.llvm.org/D121855 | 4 年前 | |
[scudo] Update header without read-modify-write operation (#66955) We used to update the deallocated block with atomic_compare_exchange_strong to ensure the concurrent double-free will be detected. However, this operation incurs huge performance overhead which takes over 50% execution time in deallocate(). Given that we already have the checksum to guard the most double-free cases and other block verifications in the primary allocator, use atomic-store instead. | 2 年前 | |
[scudo] Only print stats when the test fails. (#168000) When running the tests on other platforms, printing the stats on all of the passing tests makes it hard to see failure output. Therefore, this change only prints the stats if the test actually fails. | 8 个月前 | |
[scudo] Make release to OS test more specific. (#147852) The original version of ResidentMemorySize could be a little flaky. Replace the test with a version that verifies exactly how much of the map is resident. | 1 年前 | |
[scudo] Add ConditionVariable in SizeClassAllocator64 (#69031) This may improve the waiting of Region->MMLock while trying to refill the freelist. Instead of always waiting on the completion of populateFreeListAndPopBatch() or releaseToOSMaybe(), pushBlocks() also refills the freelist. This increases the chance of earlier return from popBatches(). The support of condition variable hasn't been done for all platforms. Therefore, add another popBatchWithCV() and it can be configured in the allocator configuration by setting Primary::UseConditionVariable and the desired ConditionVariableT. Reviewed By: cferris Differential Revision: https://reviews.llvm.org/D156146 | 2 年前 | |
[scudo][standalone] Restore GWP-ASan flag parsing With D92696, the Scudo Standalone GWP-ASan flag parsing was changed to the new GWP-ASan optional one. We do not necessarily want this, as this duplicates flag parsing code in Scudo Standalone when using the GWP-ASan integration. This CL reverts the changes within Scudo Standalone, and increases MaxFlags to 20 as an addionnal option got us to the current max. Differential Revision: https://reviews.llvm.org/D95542 | 5 年前 | |
[scudo] Support linking with index in IntrusiveList (#101262) The nodes of list may be managed in an array. Instead of managing them with pointers, using the array index will save some memory in some cases. When using the list linked with index, remember to call init() to set up the base address of the array and a EndOfListVal which is nil of the list. | 1 年前 | |
[scudo] Skip test if mlock fails. (#168448) Some linux versions might not support the mlock call, so skip that part of the test if the mlock fails. | 8 个月前 | |
[scudo] Small cleanup of memory tagging code part 2. (#168807) Make the systemSupportsMemoryTagging() function return even on system that don't support memory tagging. This avoids the need to always check if memory tagging is supported before calling the function. Modify iterateOverChunks() to call useMemoryTagging<>(Options) to determine if mte is supported. This already uses the cached check of systemSupportsMemoryTagging() rather than directly calling that function. Updated the code that calls systemSupportsMemoryTagging(). | 8 个月前 | |
[scudo] Add the thread-safety annotations This CL adds the proper thread-safety annotations for most of the functions and variables. However, given the restriction of the current architecture, in some cases, we may not be able to use the annotations easily. The followings are two exceptions, 1. enable()/disable(): Many structures in scudo are enabled/disabled by acquiring the lock in each instance. This makes those structure act like a lock. We can't mark those functions with ACQUIRE()/RELEASE() because that makes the entire allocator become another lock. In the end, that implies we need to *acquire* the allocator before each malloc et al. request. Therefore, adding a variable to tell the status of those structures may be a better way to cooperate with thread-safety annotation. 2. TSD/TSD shared/TSD exclusive: These three have simiar restrictions as mentioned above. In addition, they don't always need to be released if it's a thread local instance. However, thread-safety analysis doesn't support conditional branch. Which means we can't mark the proper annotations around the uses of TSDs. We may consider to make it consistent and which makes the code structure simpler. This CL is supposed to introduce the annotations with the least code refactoring. So only trivial thread safety issues will be addressed here. For example, lacking of acquiring certain lock before accessing certain variables will have the ScopedLock inserted. Other than that, they are supposed to be done in the later changes. Reviewed By: cferris Differential Revision: https://reviews.llvm.org/D140706 | 3 年前 | |
[scudo] Only print stats when the test fails. (#168000) When running the tests on other platforms, printing the stats on all of the passing tests makes it hard to see failure output. Therefore, this change only prints the stats if the test actually fails. | 8 个月前 | |
[scudo] Only print stats when the test fails. (#168000) When running the tests on other platforms, printing the stats on all of the passing tests makes it hard to see failure output. Therefore, this change only prints the stats if the test actually fails. | 8 个月前 | |
[scudo] Use MemMap in BufferPool and RegionPageMap (#66788) | 2 年前 | |
[scudo] Modify header corrupption error message (#126812) Update the error message to be explicit that this is likely due to memory corruption. In addition, check if the chunk header is all zero, which could mean corruption or an attempt to free a pointer after the memory has been released to the kernel. This case results in a slightly different error message to also indicate this could still be a double free. | 1 年前 | |
[scudo] Refactor the secondary test (#125595) Remove all redundant code and create a couple of structs to handle automatic init and destruction. This replaces the test fixtures in prepartion for passing in multiple configs for some of these tests. This is necessary because not all of the gtest features are supported here, and there is no easy way to create a test fixture with a template. | 1 年前 | |
[scudo] Allow using a different test main. Fuchsia already uses a different main function for tests, so allow anybody to use this mechanism. Specifically, Android has a test main that allows tests to be run in isolation and in parallel which speeds up the unit test runs from ~14 seconds to ~4 seconds. Reviewed By: Chia-hungDuan Differential Revision: https://reviews.llvm.org/D159501 | 2 年前 | |
[scudo] Small cleanup of memory tagging code part 2. (#168807) Make the systemSupportsMemoryTagging() function return even on system that don't support memory tagging. This avoids the need to always check if memory tagging is supported before calling the function. Modify iterateOverChunks() to call useMemoryTagging<>(Options) to determine if mte is supported. This already uses the cached check of systemSupportsMemoryTagging() rather than directly calling that function. Updated the code that calls systemSupportsMemoryTagging(). | 8 个月前 | |
[scudo] Only print stats when the test fails. (#168000) When running the tests on other platforms, printing the stats on all of the passing tests makes it hard to see failure output. Therefore, this change only prints the stats if the test actually fails. | 8 个月前 | |
[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 | 6 年前 | |
[scudo][NFC] Add a default unmap() to unmap all pages (#102234) | 1 年前 | |
[scudo] Fix expectation in ScudoTimingTest.VerifyMax (#106062) | 1 年前 | |
[scudo] Add primary option to enable/disable cache blocks. (#129794) When configured this way, no primary blocks will be cached except the batch class. Nothing else changes, no change in the page releasing strategy. | 1 年前 | |
[scudo][NFC] Add a default unmap() to unmap all pages (#102234) | 1 年前 | |
[scudo] Add config option to modify get usable size behavior (#158710) Currently, Scudo always returns the exact size allocated when calling getUsableSize. This can be a performance issue where some programs will get the usable size and do unnecessary calls to realloc since they think there isn't enough space in the allocation. By default, usable size will still return the exact size of the allocation. Note that if the exact behavior is disabled and MTE is on, then the code will still give an exact usable size. | 8 个月前 | |
| 8 个月前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 1 年前 | ||
| 2 年前 | ||
| 5 年前 | ||
| 6 年前 | ||
| 4 年前 | ||
| 2 年前 | ||
| 8 个月前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 5 年前 | ||
| 1 年前 | ||
| 8 个月前 | ||
| 8 个月前 | ||
| 3 年前 | ||
| 8 个月前 | ||
| 8 个月前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 8 个月前 | ||
| 8 个月前 | ||
| 6 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 8 个月前 | ||
| 8 个月前 |