-
Notifications
You must be signed in to change notification settings - Fork 11k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Scudo] Make -fsanitize=scudo use standalone. Migrate tests.
This patch moves -fsanitize=scudo to link the standalone scudo library, rather than the original compiler-rt based library. This is one of the major remaining roadblocks to deleting the compiler-rt based scudo, which should not be used any more. The standalone Scudo is better in pretty much every way and is much more suitable for production usage. As well as patching the litmus tests for checking that the scudo_standalone lib is linked instead of the scudo lib, this patch also ports all the scudo lit tests to run under scudo standalone. This patch also adds a feature to scudo standalone that was under test in the original scudo - that arguments passed to an aligned operator new were checked that the alignment was a power of two. Some lit tests could not be migrated, due to the following issues: 1. Features that aren't supported in scudo standalone, like the rss limit. 2. Different quarantine implementation where the test needs some more thought. 3. Small bugs in scudo standalone that should probably be fixed, like the Secondary allocator having a full page on the LHS of an allocation that only contains the chunk header, so underflows by <= a page aren't caught. 4. Slight differences in behaviour that's technically correct, like 'realloc(malloc(1), 0)' returns nullptr in standalone, but a real pointer in old scudo. 5. Some tests that might be migratable, but not easily. Tests that are obviously not applicable to scudo standalone (like testing that no sanitizer symbols made it into the DSO) have been deleted. After this patch, the remaining work is: 1. Update the Scudo documentation. The flags have changed, etc. 2. Delete the old version of scudo. 3. Patch up the tests in lit-unmigrated, or fix Scudo standalone. Reviewed By: cryptoad, vitalybuka Differential Revision: https://reviews.llvm.org/D102543
- Loading branch information
Showing
37 changed files
with
171 additions
and
297 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1 @@ | ||
set(SCUDO_LIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) | ||
set(SCUDO_LIT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) | ||
|
||
set(SCUDO_TESTSUITES) | ||
|
||
set(SCUDO_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS}) | ||
if(NOT COMPILER_RT_STANDALONE_BUILD) | ||
list(APPEND SCUDO_TEST_DEPS scudo) | ||
endif() | ||
|
||
configure_lit_site_cfg( | ||
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in | ||
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py | ||
) | ||
|
||
set(SCUDO_TEST_ARCH ${SCUDO_SUPPORTED_ARCH}) | ||
foreach(arch ${SCUDO_TEST_ARCH}) | ||
set(SCUDO_TEST_TARGET_ARCH ${arch}) | ||
string(TOLOWER "-${arch}" SCUDO_TEST_CONFIG_SUFFIX) | ||
get_test_cc_for_arch(${arch} SCUDO_TEST_TARGET_CC SCUDO_TEST_TARGET_CFLAGS) | ||
string(TOUPPER ${arch} ARCH_UPPER_CASE) | ||
set(CONFIG_NAME ${ARCH_UPPER_CASE}${OS_NAME}Config) | ||
|
||
configure_lit_site_cfg( | ||
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in | ||
${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg.py) | ||
list(APPEND SCUDO_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}) | ||
endforeach() | ||
|
||
add_subdirectory(standalone) | ||
|
||
add_lit_testsuite(check-scudo "Running the Scudo Hardened Allocator tests" | ||
${SCUDO_TESTSUITES} | ||
DEPENDS ${SCUDO_TEST_DEPS}) | ||
set_target_properties(check-scudo PROPERTIES FOLDER "Compiler-RT Misc") |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.