diff --git a/0005-Fix-purging-during-arena-migration-when-bgthd-on.patch b/0005-Fix-purging-during-arena-migration-when-bgthd-on.patch new file mode 100644 index 0000000000000000000000000000000000000000..036b555cf144efd0e62af067972b80a54d62fa02 --- /dev/null +++ b/0005-Fix-purging-during-arena-migration-when-bgthd-on.patch @@ -0,0 +1,31 @@ +From 19b2f51052050a7a4ad716d7bfc70e62705ed812 Mon Sep 17 00:00:00 2001 +From: Piggy +Date: Wed, 30 Jul 2025 18:39:00 +0800 +Subject: [PATCH] Fix purging during arena migration when bgthd on + +--- + src/jemalloc.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/src/jemalloc.c b/src/jemalloc.c +index 7655de4..01fa688 100644 +--- a/src/jemalloc.c ++++ b/src/jemalloc.c +@@ -477,8 +477,12 @@ arena_migrate(tsd_t *tsd, arena_t *oldarena, arena_t *newarena) { + arena_nthreads_inc(newarena, false); + tsd_arena_set(tsd, newarena); + +- if (arena_nthreads_get(oldarena, false) == 0) { +- /* Purge if the old arena has no associated threads anymore. */ ++ if (arena_nthreads_get(oldarena, false) == 0 && ++ !background_thread_enabled()) { ++ /* ++ * Purge if the old arena has no associated threads anymore and ++ * no background threads. ++ */ + arena_decay(tsd_tsdn(tsd), oldarena, + /* is_background_thread */ false, /* all */ true); + } +-- +2.36.1.windows.1 + diff --git a/jemalloc.spec b/jemalloc.spec index 4a2079e5a304705e33369c2803b7cd07134fe534..b4f78c8db6b6a7a9046406920ddedbc8a2f91844 100644 --- a/jemalloc.spec +++ b/jemalloc.spec @@ -12,7 +12,7 @@ Name: jemalloc Version: 5.3.0 -Release: 3 +Release: 4 Summary: General-purpose scalable concurrent malloc implementation License: BSD-2-Clause URL: http://www.canonware.com/jemalloc/ @@ -22,6 +22,7 @@ Patch0001: 0001-Fix-clang-test-fail-in-align_alloc.c.patch Patch0002: 0002-Fix-check-mallctl-setting-max_background_thread-by-0.patch Patch0003: 0003-Fix-possible-NULL-pointer-dereference-from-mallctl.patch Patch0004: 0004-Fix-possible-NULL-pointer-dereference-in-VERIFY_READ.patch +Patch0005: 0005-Fix-purging-during-arena-migration-when-bgthd-on.patch BuildRequires: perl-generators gcc /usr/bin/xsltproc @@ -84,6 +85,9 @@ make check %{_mandir}/man3/jemalloc.3* %changelog +* Thu Jul 31 2025 Piggy - 5.3.0-4 +- Fix purging during arena migration when bgthd on + * Wed Jul 30 2025 Piggy - 5.3.0-3 - Fix null ptr error