From 8b64be34414e92fcbcdbaf5b81db6d26289667b5 Mon Sep 17 00:00:00 2001 From: Qi Wang Date: Tue, 21 Mar 2023 14:12:12 -0700 Subject: [PATCH] Explicit arena assignment in test_tcache_max. Otherwise the associated arena could change with percpu arena enabled. --- test/unit/tcache_max.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/unit/tcache_max.c b/test/unit/tcache_max.c index 1f657c85..b1093f40 100644 --- a/test/unit/tcache_max.c +++ b/test/unit/tcache_max.c @@ -157,6 +157,13 @@ TEST_BEGIN(test_tcache_max) { test_skip_if(opt_prof); test_skip_if(san_uaf_detection_enabled()); + unsigned arena_ind; + size_t sz = sizeof(arena_ind); + expect_d_eq(mallctl("arenas.create", (void *)&arena_ind, &sz, NULL, 0), + 0, "Unexpected mallctl() failure"); + expect_d_eq(mallctl("thread.arena", NULL, NULL, &arena_ind, + sizeof(arena_ind)), 0, "Unexpected mallctl() failure"); + for (alloc_option = alloc_option_start; alloc_option < alloc_option_end; alloc_option++) {