diff --git a/fix-global_max_fast-based-on-MIN_CHUNK_SIZE.patch b/fix-global_max_fast-based-on-MIN_CHUNK_SIZE.patch new file mode 100644 index 0000000000000000000000000000000000000000..9c1ac7b0254b73f5e13396a55c80a77c59f232bb --- /dev/null +++ b/fix-global_max_fast-based-on-MIN_CHUNK_SIZE.patch @@ -0,0 +1,34 @@ +From ff12e0fb91b9072800f031cb21fb2651ee7b6251 Mon Sep 17 00:00:00 2001 +From: DJ Delorie +Date: Wed, 30 Oct 2019 18:03:14 -0400 +Subject: [PATCH] Base max_fast on alignment, not width, of bins (Bug 24903) + +set_max_fast sets the "impossibly small" value based on, +eventually, MALLOC_ALIGNMENT. The comparisons for the smallest +chunk used is, eventually, MIN_CHUNK_SIZE. Note that i386 +is the only platform where these are the same, so a smallest +chunk *would* be put in a no-fastbins fastbin. + +This change calculates the "impossibly small" value +based on MIN_CHUNK_SIZE instead, so that we can know it will +always be impossibly small. +--- + malloc/malloc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/malloc/malloc.c b/malloc/malloc.c +index cfddfb75..4832e0b8 100644 +--- a/malloc/malloc.c ++++ b/malloc/malloc.c +@@ -1624,7 +1624,7 @@ static INTERNAL_SIZE_T global_max_fast; + + #define set_max_fast(s) \ + global_max_fast = (((s) == 0) \ +- ? SMALLBIN_WIDTH : ((s + SIZE_SZ) & ~MALLOC_ALIGN_MASK)) ++ ? MIN_CHUNK_SIZE / 2 : ((s + SIZE_SZ) & ~MALLOC_ALIGN_MASK)) + + static inline INTERNAL_SIZE_T + get_max_fast (void) +-- +2.33.0 + diff --git a/glibc.spec b/glibc.spec index b2b9f56e9f7726d575bd404ac7665a2ff90bbf7b..c7604738889b0456bb935e5ea2dd73aa2182a94b 100644 --- a/glibc.spec +++ b/glibc.spec @@ -62,7 +62,7 @@ ############################################################################## Name: glibc Version: 2.28 -Release: 114 +Release: 115 Summary: The GNU libc libraries License: %{all_license} URL: http://www.gnu.org/software/glibc/ @@ -182,6 +182,7 @@ Patch95: posix-Fix-double-free-after-allocation-failure-in-re.patch Patch96: benchtests-Set-float-type-on-threshold-argument.patch Patch97: stdio-Fix-aliasing-violation.patch Patch98: use_uintptr_t_for_address_diagnostic.patch +Patch99: fix-global_max_fast-based-on-MIN_CHUNK_SIZE.patch Provides: ldconfig rtld(GNU_HASH) bundled(gnulib) @@ -1301,6 +1302,9 @@ fi %endif %changelog +* Mon Oct 20 2025 panzhe - 2.28-115 +- malloc: fix global_max_fast based on MIN_CHUNK_SIZE + * Fri Oct 17 2025 panzhe - 2.28-114 - nptl: Use uintptr_t for address diagnostic in nptl/tst-pthread-getattr