From efc539c040cf11b19ffc8af29a8cc3e5c3609092 Mon Sep 17 00:00:00 2001 From: Qi Wang Date: Fri, 21 Jan 2022 17:56:12 -0800 Subject: [PATCH] Initialize prof_leak during prof init. Otherwise, prof_leak may get set after prof_leak_error, and disagree with each other. --- src/jemalloc.c | 2 +- src/prof.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/jemalloc.c b/src/jemalloc.c index 117a005c..85c38dd6 100644 --- a/src/jemalloc.c +++ b/src/jemalloc.c @@ -1585,7 +1585,7 @@ malloc_conf_init_helper(sc_data_t *sc_data, unsigned bin_shard_sizes[SC_NBINS], "prof_leak_error is" " not allowed" " without" - " prof_leak_final", + " prof_final", k, klen, v, vlen); } else { opt_prof_leak = true; diff --git a/src/prof.c b/src/prof.c index cbfc7409..7a6d5d56 100644 --- a/src/prof.c +++ b/src/prof.c @@ -564,6 +564,9 @@ prof_boot1(void) { * opt_prof must be in its final state before any arenas are * initialized, so this function must be executed early. */ + if (opt_prof_leak_error && !opt_prof_leak) { + opt_prof_leak = true; + } if (opt_prof_leak && !opt_prof) { /*