Accepting request 215630 from devel:libraries:c_c++
- Add jemalloc-fix-32bit-tests.patch to fix test failures on i586 - Update to version 3.5.0 * Add the *allocx() API, which is a successor to the experimental *allocm() API. The *allocx() functions are slightly simpler to use because they have fewer parameters, they directly return the results of primary interest, and mallocx()/rallocx() avoid the strict aliasing pitfall that allocm()/rallocx() share with posix_memalign(). Note that *allocm() is slated for removal in the next non-bugfix release. * Add support for LinuxThreads. * Unless heap profiling is enabled, disable floating point code and don't link with libm. This, in combination with e.g. EXTRA_CFLAGS=-mno-sse on x64 systems, makes it possible to completely disable floating point register use. Some versions of glibc neglect to save/restore caller-saved floating point registers during dynamic lazy symbol loading, and the symbol loading code uses whatever malloc the application happens to have linked/loaded with, the result being potential floating point register corruption. * Report ENOMEM rather than EINVAL if an OOM occurs during heap profiling backtrace creation in imemalign(). This bug impacted posix_memalign() and aligned_alloc(). * Fix a file descriptor leak in a prof_dump_maps() error path. * Fix prof_dump() to close the dump file descriptor for all relevant error paths. * Fix rallocm() to use the arena specified by the ALLOCM_ARENA(s) flag for allocation, not just deallocation. * Fix a data race for large allocation stats counters. * Fix a potential infinite loop during thread exit. This bug occurred on Solaris, and could affect other platforms with similar pthreads TSD implementations. * Don't junk-fill reallocations unless usable size changes. This fixes a OBS-URL: https://build.opensuse.org/request/show/215630 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/jemalloc?expand=0&rev=8
This commit is contained in:
commit
c653443c60
@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:7341953fe9f21342b005b6c7e798631678ae713293a64d5fa61dea7449fc10fb
|
|
||||||
size 254149
|
|
3
jemalloc-3.5.0.tar.bz2
Normal file
3
jemalloc-3.5.0.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:5b13dbef27c46e9efbe19b5eef574e298409ed9dbbde85ec805e29d04c05e473
|
||||||
|
size 335796
|
234
jemalloc-fix-32bit-tests.patch
Normal file
234
jemalloc-fix-32bit-tests.patch
Normal file
@ -0,0 +1,234 @@
|
|||||||
|
diff --git a/test/integration/aligned_alloc.c b/test/integration/aligned_alloc.c
|
||||||
|
index 17c2151..6090014 100644
|
||||||
|
--- a/test/integration/aligned_alloc.c
|
||||||
|
+++ b/test/integration/aligned_alloc.c
|
||||||
|
@@ -47,10 +47,10 @@ TEST_BEGIN(test_oom_errors)
|
||||||
|
|
||||||
|
#if LG_SIZEOF_PTR == 3
|
||||||
|
alignment = UINT64_C(0x4000000000000000);
|
||||||
|
- size = UINT64_C(0x8400000000000001);
|
||||||
|
+ size = UINT64_C(0xc000000000000001);
|
||||||
|
#else
|
||||||
|
alignment = 0x40000000LU;
|
||||||
|
- size = 0x84000001LU;
|
||||||
|
+ size = 0xc0000001LU;
|
||||||
|
#endif
|
||||||
|
set_errno(0);
|
||||||
|
p = aligned_alloc(alignment, size);
|
||||||
|
diff --git a/test/integration/mallocx.c b/test/integration/mallocx.c
|
||||||
|
index c26f6c5..f37a74b 100644
|
||||||
|
--- a/test/integration/mallocx.c
|
||||||
|
+++ b/test/integration/mallocx.c
|
||||||
|
@@ -34,26 +34,6 @@ TEST_BEGIN(test_basic)
|
||||||
|
}
|
||||||
|
TEST_END
|
||||||
|
|
||||||
|
-TEST_BEGIN(test_alignment_errors)
|
||||||
|
-{
|
||||||
|
- void *p;
|
||||||
|
- size_t nsz, sz, alignment;
|
||||||
|
-
|
||||||
|
-#if LG_SIZEOF_PTR == 3
|
||||||
|
- alignment = UINT64_C(0x4000000000000000);
|
||||||
|
- sz = UINT64_C(0x8400000000000001);
|
||||||
|
-#else
|
||||||
|
- alignment = 0x40000000LU;
|
||||||
|
- sz = 0x84000001LU;
|
||||||
|
-#endif
|
||||||
|
- nsz = nallocx(sz, MALLOCX_ALIGN(alignment));
|
||||||
|
- assert_zu_ne(nsz, 0, "Unexpected nallocx() error");
|
||||||
|
- p = mallocx(sz, MALLOCX_ALIGN(alignment));
|
||||||
|
- assert_ptr_null(p, "Expected error for mallocx(%zu, %#x)", sz,
|
||||||
|
- MALLOCX_ALIGN(alignment));
|
||||||
|
-}
|
||||||
|
-TEST_END
|
||||||
|
-
|
||||||
|
TEST_BEGIN(test_alignment_and_size)
|
||||||
|
{
|
||||||
|
size_t nsz, rsz, sz, alignment, total;
|
||||||
|
@@ -114,6 +94,5 @@ main(void)
|
||||||
|
|
||||||
|
return (test(
|
||||||
|
test_basic,
|
||||||
|
- test_alignment_errors,
|
||||||
|
test_alignment_and_size));
|
||||||
|
}
|
||||||
|
diff --git a/test/integration/posix_memalign.c b/test/integration/posix_memalign.c
|
||||||
|
index c88a4dc..19741c6 100644
|
||||||
|
--- a/test/integration/posix_memalign.c
|
||||||
|
+++ b/test/integration/posix_memalign.c
|
||||||
|
@@ -43,10 +43,10 @@ TEST_BEGIN(test_oom_errors)
|
||||||
|
|
||||||
|
#if LG_SIZEOF_PTR == 3
|
||||||
|
alignment = UINT64_C(0x4000000000000000);
|
||||||
|
- size = UINT64_C(0x8400000000000001);
|
||||||
|
+ size = UINT64_C(0xc000000000000001);
|
||||||
|
#else
|
||||||
|
alignment = 0x40000000LU;
|
||||||
|
- size = 0x84000001LU;
|
||||||
|
+ size = 0xc0000001LU;
|
||||||
|
#endif
|
||||||
|
assert_d_ne(posix_memalign(&p, alignment, size), 0,
|
||||||
|
"Expected error for posix_memalign(&p, %zu, %zu)",
|
||||||
|
diff --git a/test/unit/stats.c b/test/unit/stats.c
|
||||||
|
index 6cd9773..03a55c7 100644
|
||||||
|
--- a/test/unit/stats.c
|
||||||
|
+++ b/test/unit/stats.c
|
||||||
|
@@ -31,21 +31,25 @@ TEST_END
|
||||||
|
|
||||||
|
TEST_BEGIN(test_stats_chunks)
|
||||||
|
{
|
||||||
|
- size_t current, total, high;
|
||||||
|
- size_t sz = sizeof(size_t);
|
||||||
|
+ size_t current, high;
|
||||||
|
+ uint64_t total;
|
||||||
|
+ size_t sz;
|
||||||
|
int expected = config_stats ? 0 : ENOENT;
|
||||||
|
|
||||||
|
+ sz = sizeof(size_t);
|
||||||
|
assert_d_eq(mallctl("stats.chunks.current", ¤t, &sz, NULL, 0),
|
||||||
|
expected, "Unexpected mallctl() result");
|
||||||
|
+ sz = sizeof(uint64_t);
|
||||||
|
assert_d_eq(mallctl("stats.chunks.total", &total, &sz, NULL, 0),
|
||||||
|
expected, "Unexpected mallctl() result");
|
||||||
|
+ sz = sizeof(size_t);
|
||||||
|
assert_d_eq(mallctl("stats.chunks.high", &high, &sz, NULL, 0), expected,
|
||||||
|
"Unexpected mallctl() result");
|
||||||
|
|
||||||
|
if (config_stats) {
|
||||||
|
assert_zu_le(current, high,
|
||||||
|
"current should be no larger than high");
|
||||||
|
- assert_zu_le(high, total,
|
||||||
|
+ assert_u64_le((uint64_t)high, total,
|
||||||
|
"high should be no larger than total");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -247,9 +251,9 @@ TEST_BEGIN(test_stats_arenas_bins)
|
||||||
|
{
|
||||||
|
unsigned arena;
|
||||||
|
void *p;
|
||||||
|
- size_t sz, allocated;
|
||||||
|
+ size_t sz, allocated, curruns;
|
||||||
|
uint64_t epoch, nmalloc, ndalloc, nrequests, nfills, nflushes;
|
||||||
|
- uint64_t nruns, nreruns, curruns;
|
||||||
|
+ uint64_t nruns, nreruns;
|
||||||
|
int expected = config_stats ? 0 : ENOENT;
|
||||||
|
|
||||||
|
arena = 0;
|
||||||
|
@@ -287,6 +291,7 @@ TEST_BEGIN(test_stats_arenas_bins)
|
||||||
|
NULL, 0), expected, "Unexpected mallctl() result");
|
||||||
|
assert_d_eq(mallctl("stats.arenas.0.bins.0.nreruns", &nreruns, &sz,
|
||||||
|
NULL, 0), expected, "Unexpected mallctl() result");
|
||||||
|
+ sz = sizeof(size_t);
|
||||||
|
assert_d_eq(mallctl("stats.arenas.0.bins.0.curruns", &curruns, &sz,
|
||||||
|
NULL, 0), expected, "Unexpected mallctl() result");
|
||||||
|
|
||||||
|
@@ -307,7 +312,7 @@ TEST_BEGIN(test_stats_arenas_bins)
|
||||||
|
}
|
||||||
|
assert_u64_gt(nruns, 0,
|
||||||
|
"At least one run should have been allocated");
|
||||||
|
- assert_u64_gt(curruns, 0,
|
||||||
|
+ assert_zu_gt(curruns, 0,
|
||||||
|
"At least one run should be currently allocated");
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -319,8 +324,8 @@ TEST_BEGIN(test_stats_arenas_lruns)
|
||||||
|
{
|
||||||
|
unsigned arena;
|
||||||
|
void *p;
|
||||||
|
- uint64_t epoch, nmalloc, ndalloc, nrequests, curruns;
|
||||||
|
- size_t sz = sizeof(uint64_t);
|
||||||
|
+ uint64_t epoch, nmalloc, ndalloc, nrequests;
|
||||||
|
+ size_t curruns, sz;
|
||||||
|
int expected = config_stats ? 0 : ENOENT;
|
||||||
|
|
||||||
|
arena = 0;
|
||||||
|
@@ -333,12 +338,14 @@ TEST_BEGIN(test_stats_arenas_lruns)
|
||||||
|
assert_d_eq(mallctl("epoch", NULL, NULL, &epoch, sizeof(epoch)), 0,
|
||||||
|
"Unexpected mallctl() failure");
|
||||||
|
|
||||||
|
+ sz = sizeof(uint64_t);
|
||||||
|
assert_d_eq(mallctl("stats.arenas.0.lruns.0.nmalloc", &nmalloc, &sz,
|
||||||
|
NULL, 0), expected, "Unexpected mallctl() result");
|
||||||
|
assert_d_eq(mallctl("stats.arenas.0.lruns.0.ndalloc", &ndalloc, &sz,
|
||||||
|
NULL, 0), expected, "Unexpected mallctl() result");
|
||||||
|
assert_d_eq(mallctl("stats.arenas.0.lruns.0.nrequests", &nrequests, &sz,
|
||||||
|
NULL, 0), expected, "Unexpected mallctl() result");
|
||||||
|
+ sz = sizeof(size_t);
|
||||||
|
assert_d_eq(mallctl("stats.arenas.0.lruns.0.curruns", &curruns, &sz,
|
||||||
|
NULL, 0), expected, "Unexpected mallctl() result");
|
||||||
|
|
||||||
|
diff --git a/test/integration/allocm.c b/test/integration/allocm.c
|
||||||
|
index bd7a3ca..66ecf86 100644
|
||||||
|
--- a/test/integration/allocm.c
|
||||||
|
+++ b/test/integration/allocm.c
|
||||||
|
@@ -39,28 +39,6 @@ TEST_BEGIN(test_basic)
|
||||||
|
}
|
||||||
|
TEST_END
|
||||||
|
|
||||||
|
-TEST_BEGIN(test_alignment_errors)
|
||||||
|
-{
|
||||||
|
- void *p;
|
||||||
|
- size_t nsz, rsz, sz, alignment;
|
||||||
|
-
|
||||||
|
-#if LG_SIZEOF_PTR == 3
|
||||||
|
- alignment = UINT64_C(0x4000000000000000);
|
||||||
|
- sz = UINT64_C(0x8400000000000001);
|
||||||
|
-#else
|
||||||
|
- alignment = 0x40000000LU;
|
||||||
|
- sz = 0x84000001LU;
|
||||||
|
-#endif
|
||||||
|
- nsz = 0;
|
||||||
|
- assert_d_eq(nallocm(&nsz, sz, ALLOCM_ALIGN(alignment)), ALLOCM_SUCCESS,
|
||||||
|
- "Unexpected nallocm() error");
|
||||||
|
- rsz = 0;
|
||||||
|
- assert_d_ne(allocm(&p, &rsz, sz, ALLOCM_ALIGN(alignment)),
|
||||||
|
- ALLOCM_SUCCESS, "Expected error for allocm(&p, %zu, %#x)",
|
||||||
|
- sz, ALLOCM_ALIGN(alignment));
|
||||||
|
-}
|
||||||
|
-TEST_END
|
||||||
|
-
|
||||||
|
TEST_BEGIN(test_alignment_and_size)
|
||||||
|
{
|
||||||
|
int r;
|
||||||
|
@@ -126,6 +104,5 @@ main(void)
|
||||||
|
|
||||||
|
return (test(
|
||||||
|
test_basic,
|
||||||
|
- test_alignment_errors,
|
||||||
|
test_alignment_and_size));
|
||||||
|
}
|
||||||
|
diff --git a/test/unit/prof_accum.c b/test/unit/prof_accum.c
|
||||||
|
index cf3f287..08be419 100644
|
||||||
|
--- a/test/unit/prof_accum.c
|
||||||
|
+++ b/test/unit/prof_accum.c
|
||||||
|
@@ -22,10 +22,10 @@ prof_dump_open_intercept(bool propagate_err, const char *filename)
|
||||||
|
}
|
||||||
|
|
||||||
|
#define alloc_n_proto(n) \
|
||||||
|
-static void *alloc_##n(unsigned bits);
|
||||||
|
+JEMALLOC_NOINLINE static void *alloc_##n(unsigned bits);
|
||||||
|
|
||||||
|
#define alloc_n_gen(n) \
|
||||||
|
-static void * \
|
||||||
|
+JEMALLOC_NOINLINE static void * \
|
||||||
|
alloc_##n(unsigned bits) \
|
||||||
|
{ \
|
||||||
|
void *p; \
|
||||||
|
diff --git a/include/jemalloc/internal/prof.h b/include/jemalloc/internal/prof.h
|
||||||
|
index db056fc..6f162d2 100644
|
||||||
|
--- a/include/jemalloc/internal/prof.h
|
||||||
|
+++ b/include/jemalloc/internal/prof.h
|
||||||
|
@@ -8,7 +8,11 @@ typedef struct prof_ctx_s prof_ctx_t;
|
||||||
|
typedef struct prof_tdata_s prof_tdata_t;
|
||||||
|
|
||||||
|
/* Option defaults. */
|
||||||
|
-#define PROF_PREFIX_DEFAULT "jeprof"
|
||||||
|
+#ifdef JEMALLOC_PROF
|
||||||
|
+# define PROF_PREFIX_DEFAULT "jeprof"
|
||||||
|
+#else
|
||||||
|
+# define PROF_PREFIX_DEFAULT ""
|
||||||
|
+#endif
|
||||||
|
#define LG_PROF_SAMPLE_DEFAULT 19
|
||||||
|
#define LG_PROF_INTERVAL_DEFAULT -1
|
||||||
|
|
@ -1,3 +1,58 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Jan 29 12:24:21 UTC 2014 - idonmez@suse.com
|
||||||
|
|
||||||
|
- Add jemalloc-fix-32bit-tests.patch to fix test failures on i586
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Jan 24 12:02:33 UTC 2014 - idonmez@suse.com
|
||||||
|
|
||||||
|
- Update to version 3.5.0
|
||||||
|
* Add the *allocx() API, which is a successor to the experimental *allocm()
|
||||||
|
API. The *allocx() functions are slightly simpler to use because they have
|
||||||
|
fewer parameters, they directly return the results of primary interest, and
|
||||||
|
mallocx()/rallocx() avoid the strict aliasing pitfall that
|
||||||
|
allocm()/rallocx() share with posix_memalign(). Note that *allocm() is
|
||||||
|
slated for removal in the next non-bugfix release.
|
||||||
|
* Add support for LinuxThreads.
|
||||||
|
|
||||||
|
* Unless heap profiling is enabled, disable floating point code and don't link
|
||||||
|
with libm. This, in combination with e.g. EXTRA_CFLAGS=-mno-sse on x64
|
||||||
|
systems, makes it possible to completely disable floating point register
|
||||||
|
use. Some versions of glibc neglect to save/restore caller-saved floating
|
||||||
|
point registers during dynamic lazy symbol loading, and the symbol loading
|
||||||
|
code uses whatever malloc the application happens to have linked/loaded
|
||||||
|
with, the result being potential floating point register corruption.
|
||||||
|
* Report ENOMEM rather than EINVAL if an OOM occurs during heap profiling
|
||||||
|
backtrace creation in imemalign(). This bug impacted posix_memalign() and
|
||||||
|
aligned_alloc().
|
||||||
|
* Fix a file descriptor leak in a prof_dump_maps() error path.
|
||||||
|
* Fix prof_dump() to close the dump file descriptor for all relevant error
|
||||||
|
paths.
|
||||||
|
* Fix rallocm() to use the arena specified by the ALLOCM_ARENA(s) flag for
|
||||||
|
allocation, not just deallocation.
|
||||||
|
* Fix a data race for large allocation stats counters.
|
||||||
|
* Fix a potential infinite loop during thread exit. This bug occurred on
|
||||||
|
Solaris, and could affect other platforms with similar pthreads TSD
|
||||||
|
implementations.
|
||||||
|
* Don't junk-fill reallocations unless usable size changes. This fixes a
|
||||||
|
violation of the *allocx()/*allocm() semantics.
|
||||||
|
* Fix growing large reallocation to junk fill new space.
|
||||||
|
* Fix huge deallocation to junk fill when munmap is disabled.
|
||||||
|
* Change the default private namespace prefix from empty to je_, and change
|
||||||
|
--with-private-namespace-prefix so that it prepends an additional prefix
|
||||||
|
rather than replacing je_. This reduces the likelihood of applications
|
||||||
|
which statically link jemalloc experiencing symbol name collisions.
|
||||||
|
* Add missing private namespace mangling (relevant when
|
||||||
|
--with-private-namespace is specified).
|
||||||
|
* Add and use JEMALLOC_INLINE_C so that static inline functions are marked as
|
||||||
|
static even for debug builds.
|
||||||
|
* Add a missing mutex unlock in a malloc_init_hard() error path. In practice
|
||||||
|
this error path is never executed.
|
||||||
|
* Fix numerous bugs in malloc_strotumax() error handling/reporting. These
|
||||||
|
bugs had no impact except for malformed inputs.
|
||||||
|
* Fix numerous bugs in malloc_snprintf(). These bugs were not exercised by
|
||||||
|
existing calls, so they had no impact.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue Oct 22 09:28:50 UTC 2013 - idonmez@suse.com
|
Tue Oct 22 09:28:50 UTC 2013 - idonmez@suse.com
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package jemalloc
|
# spec file for package jemalloc
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
|
|
||||||
Name: jemalloc
|
Name: jemalloc
|
||||||
Version: 3.4.1
|
Version: 3.5.0
|
||||||
Release: 0
|
Release: 0
|
||||||
%define lname libjemalloc1
|
%define lname libjemalloc1
|
||||||
Summary: General-purpose scalable concurrent malloc implementation
|
Summary: General-purpose scalable concurrent malloc implementation
|
||||||
@ -27,6 +27,7 @@ Url: http://canonware.com/jemalloc/
|
|||||||
|
|
||||||
#Git-Clone: git://canonware.com/jemalloc
|
#Git-Clone: git://canonware.com/jemalloc
|
||||||
Source: http://www.canonware.com/download/jemalloc/jemalloc-%{version}.tar.bz2
|
Source: http://www.canonware.com/download/jemalloc/jemalloc-%{version}.tar.bz2
|
||||||
|
Patch1: jemalloc-fix-32bit-tests.patch
|
||||||
BuildRequires: docbook-xsl-stylesheets
|
BuildRequires: docbook-xsl-stylesheets
|
||||||
BuildRequires: libxslt
|
BuildRequires: libxslt
|
||||||
Requires: %lname = %{version}
|
Requires: %lname = %{version}
|
||||||
@ -64,17 +65,19 @@ malloc(3) implementation.
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q
|
%setup -q
|
||||||
|
%patch1 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
export CFLAGS="%{optflags} -g2";
|
export EXTRA_CFLAGS="%{optflags} -std=gnu99"
|
||||||
%configure
|
%configure --enable-cc-silence
|
||||||
make %{?_smp_mflags};
|
make %{?_smp_mflags}
|
||||||
|
|
||||||
%install
|
%install
|
||||||
b=%{buildroot};
|
b=%{buildroot};
|
||||||
make install DESTDIR="$b";
|
make install DESTDIR="$b"
|
||||||
|
|
||||||
|
chmod -x "%{buildroot}/%{_libdir}"/*.a
|
||||||
|
|
||||||
chmod -x "%{buildroot}/%{_libdir}"/*.a;
|
|
||||||
if [ "%_docdir" != "%{_datadir}/doc" ]; then
|
if [ "%_docdir" != "%{_datadir}/doc" ]; then
|
||||||
# stupid Makefile does not allow to set it
|
# stupid Makefile does not allow to set it
|
||||||
mkdir -p "$b/%_docdir";
|
mkdir -p "$b/%_docdir";
|
||||||
@ -84,6 +87,7 @@ fi;
|
|||||||
mv %{buildroot}/%{_bindir}/pprof %{buildroot}/%{_bindir}/pprof-jemalloc
|
mv %{buildroot}/%{_bindir}/pprof %{buildroot}/%{_bindir}/pprof-jemalloc
|
||||||
|
|
||||||
%check
|
%check
|
||||||
|
export LD_LIBRARY_PATH=$PWD/lib:$LD_LIBRARY_PATH
|
||||||
make check
|
make check
|
||||||
|
|
||||||
%files
|
%files
|
||||||
|
Loading…
Reference in New Issue
Block a user