San: Avoid running san tests with prof enabled

With prof enabled, number of page aligned allocations doesn't match the
number of slab "ends" because prof allocations skew the addresses. It
leads to 'pages' array overflow and hard to debug failures.
This commit is contained in:
Alex Lapenkou 2021-10-22 17:23:09 -07:00 committed by Alexander Lapenkov
parent 62f9c54d2a
commit 34b00f8969

View File

@ -14,6 +14,8 @@ verify_extent_guarded(tsdn_t *tsdn, void *ptr) {
void *small_alloc[MAX_SMALL_ALLOCATIONS];
TEST_BEGIN(test_guarded_small) {
test_skip_if(opt_prof);
tsdn_t *tsdn = tsd_tsdn(tsd_fetch());
unsigned npages = 16, pages_found = 0, ends_found = 0;
VARIABLE_ARRAY(uintptr_t, pages, npages);
@ -27,6 +29,8 @@ TEST_BEGIN(test_guarded_small) {
small_alloc[n_alloc] = ptr;
verify_extent_guarded(tsdn, ptr);
if ((uintptr_t)ptr % PAGE == 0) {
assert_u_lt(pages_found, npages,
"Unexpectedly large number of page aligned allocs");
pages[pages_found++] = (uintptr_t)ptr;
}
if (((uintptr_t)ptr + (uintptr_t)sz) % PAGE == 0) {