fix large bin index accessed through cache bin descriptor

This commit is contained in:
g00523939 2021-11-03 15:51:08 +08:00
parent 37279c9bca
commit c2ff32f41e
2 changed files with 24 additions and 1 deletions

View File

@ -0,0 +1,19 @@
diff -Nur jemalloc-5.2.1/src/arena.c tmp/src/arena.c
--- jemalloc-5.2.1/src/arena.c 2019-08-06 04:02:00.000000000 +0800
+++ tmp/src/arena.c 2021-11-03 10:23:41.243648055 +0800
@@ -199,13 +199,12 @@
malloc_mutex_lock(tsdn, &arena->tcache_ql_mtx);
cache_bin_array_descriptor_t *descriptor;
ql_foreach(descriptor, &arena->cache_bin_array_descriptor_ql, link) {
- szind_t i = 0;
- for (; i < SC_NBINS; i++) {
+ for (szind_t i = 0; i < SC_NBINS; i++) {
cache_bin_t *tbin = &descriptor->bins_small[i];
arena_stats_accum_zu(&astats->tcache_bytes,
tbin->ncached * sz_index2size(i));
}
- for (; i < nhbins; i++) {
+ for (szind_t i = 0; i < nhbins - SC_NBINS; i++) {
cache_bin_t *tbin = &descriptor->bins_large[i];
arena_stats_accum_zu(&astats->tcache_bytes,
tbin->ncached * sz_index2size(i));

View File

@ -12,12 +12,13 @@
Name: jemalloc
Version: 5.2.1
Release: 1
Release: 2
Summary: General-purpose scalable concurrent malloc implementation
License: BSD
URL: http://www.canonware.com/jemalloc/
Source0: https://github.com/jemalloc/%{name}/releases/download/%{version}/%{name}-%{version}.tar.bz2
Patch1: backport-Jemalloc-5.2.1-patch-1-fix-large-bin-index-accessed-through-cache-bin-descriptor.patch
BuildRequires: libxslt perl-generators gcc
%description
@ -81,6 +82,9 @@ make check
%{_mandir}/man3/jemalloc.3*
%changelog
* Wed Nov 3 2021 guominghong <guominghong@huawei.com> - 5.2.1-1
- Fix large bin index accessed through cache bin descriptor
* Tue Jul 20 2021 weidong <weidong@uniontech.com> - 5.2.1-1
- Update jemlloc