From 77b74db130abe1ef12e93d2d30b45c85080facf7 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Apr 10 2018 05:36:11 +0000 Subject: import gperftools-2.6.1-1.el7 --- diff --git a/.gitignore b/.gitignore index 937aac7..780bd75 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/gperftools-2.4.tar.gz +SOURCES/gperftools-2.6.1.tar.gz diff --git a/.gperftools.metadata b/.gperftools.metadata index 9d16532..1a1400e 100644 --- a/.gperftools.metadata +++ b/.gperftools.metadata @@ -1 +1 @@ -13b904d0d1f220e43e4495f3403ee280c6da26ea SOURCES/gperftools-2.4.tar.gz +5cd8da3d3b928fc5b06c018804196b657940a5d2 SOURCES/gperftools-2.6.1.tar.gz diff --git a/SOURCES/gp-Use-initial-exec-tls-for-libunwind-s-recursion-flag.patch b/SOURCES/gp-Use-initial-exec-tls-for-libunwind-s-recursion-flag.patch deleted file mode 100644 index 1d588d5..0000000 --- a/SOURCES/gp-Use-initial-exec-tls-for-libunwind-s-recursion-flag.patch +++ /dev/null @@ -1,94 +0,0 @@ -From 6737c9f59a523a4813f6e825bfbf3db2dcb00432 Mon Sep 17 00:00:00 2001 -From: Paolo Bonzini -Date: Wed, 15 Jun 2016 22:19:56 +0200 -Subject: [PATCH] Use initial-exec tls for libunwind's recursion flag - -RH-Author: Paolo Bonzini -Message-id: <1466029196-19454-1-git-send-email-pbonzini@redhat.com> -Patchwork-id: 70630 -O-Subject: [RHEL7.3 PATCH gperftools] Use initial-exec tls for libunwind's recursion flag -Bugzilla: 1339710 -RH-Acked-by: Miroslav Rezanina -RH-Acked-by: Bandan Das -RH-Acked-by: Laszlo Ersek - -From: Aliaksey Kandratsenka - -Bugzilla: 1339710 - -Brew build: 11181349 - -If we don't do it, then reading variable calls to __tls_get_addr, which -uses malloc on first call. initial-exec makes dynamic linker reserve tls -offset for recusion flag early and thus avoid unsafe calls to malloc. - -This fixes issue #786. - -Signed-off-by: Paolo Bonzini -(cherry picked from commit 7852eeb75b9375cf52a7da01be044da6e915dd08) -Signed-off-by: Miroslav Rezanina ---- - src/base/basictypes.h | 6 ++++++ - src/stacktrace_libunwind-inl.h | 4 +++- - src/thread_cache.h | 6 ------ - 3 files changed, 9 insertions(+), 7 deletions(-) - -diff --git a/src/base/basictypes.h b/src/base/basictypes.h -index 4779611..d7c0f7a 100644 ---- a/src/base/basictypes.h -+++ b/src/base/basictypes.h -@@ -192,6 +192,12 @@ struct CompileAssert { - # define ATTRIBUTE_UNUSED - #endif - -+#if defined(HAVE___ATTRIBUTE__) && defined(HAVE_TLS) -+#define ATTR_INITIAL_EXEC __attribute__ ((tls_model ("initial-exec"))) -+#else -+#define ATTR_INITIAL_EXEC -+#endif -+ - #define COMPILE_ASSERT(expr, msg) \ - typedef CompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1] ATTRIBUTE_UNUSED - -diff --git a/src/stacktrace_libunwind-inl.h b/src/stacktrace_libunwind-inl.h -index 8a4a731..6f361ec 100644 ---- a/src/stacktrace_libunwind-inl.h -+++ b/src/stacktrace_libunwind-inl.h -@@ -47,6 +47,8 @@ extern "C" { - #include - } - #include "gperftools/stacktrace.h" -+ -+#include "base/basictypes.h" - #include "base/logging.h" - - // Sometimes, we can try to get a stack trace from within a stack -@@ -56,7 +58,7 @@ extern "C" { - // recursive request, we'd end up with infinite recursion or deadlock. - // Luckily, it's safe to ignore those subsequent traces. In such - // cases, we return 0 to indicate the situation. --static __thread int recursive; -+static __thread int recursive ATTR_INITIAL_EXEC; - - #if defined(TCMALLOC_ENABLE_UNWIND_FROM_UCONTEXT) && (defined(__i386__) || defined(__x86_64__)) && defined(__GNU_LIBRARY__) - #define BASE_STACKTRACE_UNW_CONTEXT_IS_UCONTEXT 1 -diff --git a/src/thread_cache.h b/src/thread_cache.h -index 5edcdfb..27109af 100644 ---- a/src/thread_cache.h -+++ b/src/thread_cache.h -@@ -252,12 +252,6 @@ class ThreadCache { - // Since we don't really use dlopen in google code -- and using dlopen - // on a malloc replacement is asking for trouble in any case -- that's - // a good tradeoff for us. --#ifdef HAVE___ATTRIBUTE__ --#define ATTR_INITIAL_EXEC __attribute__ ((tls_model ("initial-exec"))) --#else --#define ATTR_INITIAL_EXEC --#endif -- - #ifdef HAVE_TLS - struct ThreadLocalData { - ThreadCache* heap; --- -1.8.3.1 - diff --git a/SOURCES/gperf-allow-customizing-trace-filename.patch b/SOURCES/gperf-allow-customizing-trace-filename.patch deleted file mode 100644 index 2056aac..0000000 --- a/SOURCES/gperf-allow-customizing-trace-filename.patch +++ /dev/null @@ -1,60 +0,0 @@ -allow customizing the trace file name - -Message-id: <1438961446-14046-1-git-send-email-pbonzini@redhat.com> -Patchwork-id: 67396 -O-Subject: [RHEL7.2 PATCH gperftools] allow customizing the trace file name -Bugzilla: 1232702 -RH-Acked-by: Thomas Huth -RH-Acked-by: Jeff Nelson -RH-Acked-by: Miroslav Rezanina - -The debug version of tcmalloc opens a hard-coded file in /tmp. Arguably, -this is not a vulnerability because it just affects debugging, but we -should still fix this before shipping gperftools. The file is still -hard-coded, but at least multiple developers can use tcmalloc tracing -at the same time. - -(cherry picked from upstream commit 36066b8df4bc) - - - - -diff --git a/src/debugallocation.cc b/src/debugallocation.cc -index 2a8a20e..1f6296b 100644 ---- a/src/debugallocation.cc -+++ b/src/debugallocation.cc -@@ -884,6 +884,9 @@ static void TracePrintf(int fd, const char *fmt, ...) { - va_start(ap, fmt); - const char *p = fmt; - char numbuf[25]; -+ if (fd < 0) { -+ return; -+ } - numbuf[sizeof(numbuf)-1] = 0; - while (*p != '\0') { // until end of format string - char *s = &numbuf[sizeof(numbuf)-1]; -@@ -955,11 +958,20 @@ static void TracePrintf(int fd, const char *fmt, ...) { - static int TraceFd() { - static int trace_fd = -1; - if (trace_fd == -1) { // Open the trace file on the first call -- trace_fd = open("/tmp/google.alloc", O_CREAT|O_TRUNC|O_WRONLY, 0666); -+ const char *val = getenv("TCMALLOC_TRACE_FILE"); -+ bool fallback_to_stderr = false; -+ if (!val) { -+ val = "/tmp/google.alloc"; -+ fallback_to_stderr = true; -+ } -+ trace_fd = open(val, O_CREAT|O_TRUNC|O_WRONLY, 0666); - if (trace_fd == -1) { -- trace_fd = 2; -- TracePrintf(trace_fd, -- "Can't open /tmp/google.alloc. Logging to stderr.\n"); -+ if (fallback_to_stderr) { -+ trace_fd = 2; -+ TracePrintf(trace_fd, "Can't open %s. Logging to stderr.\n", val); -+ } else { -+ TracePrintf(2, "Can't open %s. Logging disabled.\n", val); -+ } - } - // Add a header to the log. - TracePrintf(trace_fd, "Trace started: %lu\n", diff --git a/SPECS/gperftools.spec b/SPECS/gperftools.spec index 4b59ec7..3be4f23 100644 --- a/SPECS/gperftools.spec +++ b/SPECS/gperftools.spec @@ -3,23 +3,15 @@ %{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}} Name: gperftools -Version: 2.4 -Release: 8%{?dist} +Version: 2.6.1 +Release: 1%{?dist} License: BSD Group: Development/Tools Summary: Very fast malloc and performance analysis tools URL: http://code.google.com/p/gperftools/ Source0: https://googledrive.com/host/0B6NtGsLhIcf7MWxMMF9JdTN3UVk/%{name}-%{version}.tar.gz -# For bz 1232702 - gperftools: tcmalloc debug version uses hard-coded path /tmp/google.alloc -Patch1: gperf-allow-customizing-trace-filename.patch -# For bz#1339710 - initalization of 'recursive' tls variable in libunwind stack capturer occasionally triggers deadlock in ceph -Patch2: gp-Use-initial-exec-tls-for-libunwind-s-recursion-flag.patch -ExcludeArch: s390 s390x -%ifnarch ppc %{power64} -BuildRequires: libunwind-devel -%endif Requires: gperftools-devel = %{version}-%{release} Requires: pprof = %{version}-%{release} @@ -62,8 +54,7 @@ Pprof is a heap and CPU profiler tool, part of the gperftools suite. %prep %setup -q -%patch1 -p1 -%patch2 -p1 + # Fix end-of-line encoding sed -i 's/\r//' README_windows.txt @@ -74,7 +65,7 @@ chmod -x src/*.h src/*.cc %build CFLAGS=`echo $RPM_OPT_FLAGS -fno-strict-aliasing -Wno-unused-local-typedefs -DTCMALLOC_LARGE_PAGES | sed -e 's|-fexceptions||g'` CXXFLAGS=`echo $RPM_OPT_FLAGS -fno-strict-aliasing -Wno-unused-local-typedefs -DTCMALLOC_LARGE_PAGES | sed -e 's|-fexceptions||g'` -%configure --disable-static +%configure --disable-static --disable-libunwind # Bad rpath! sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool @@ -116,6 +107,14 @@ rm -rf %{buildroot}%{_pkgdocdir}/INSTALL %{_libdir}/*.so.* %changelog +* Thu Oct 12 2017 Miroslav Rezanina - 2.4-8.el7 +- Rebase to 2.6.1 [bz#1431240] +- Removed libunwind usage [bz#1467203] +- Resolves: bz#1431240 + (gperftools fails to build on s390x, lacks s390x support) +- Resolves: bz#1467203 + (Please, remove libunwind from the gperftools-libs (and 389-ds-base) requirements) + * Wed Jun 22 2016 Miroslav Rezanina - 2.4-8.el7 - gp-Use-initial-exec-tls-for-libunwind-s-recursion-flag.patch [bz#1339710] - Resolves: bz#1339710