diff --git a/avoid-exceed-int-range.patch b/avoid-exceed-int-range.patch new file mode 100644 index 0000000..4d03938 --- /dev/null +++ b/avoid-exceed-int-range.patch @@ -0,0 +1,33 @@ +From 85158d45ec66c34f5903a15c3b74600a925703ef Mon Sep 17 00:00:00 2001 +From: zhangyiru +Date: Thu, 14 Oct 2021 22:16:15 +0800 +Subject: [PATCH] avoid display problem if memleak exceeds range of int +if memleak exceeds range of int, heap checker result is incorrect, so +change it to size_t +--- + src/heap-profile-table.cc | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) +diff --git a/src/heap-profile-table.cc b/src/heap-profile-table.cc +index c3ce41c..1001fb3 100644 +--- a/src/heap-profile-table.cc ++++ b/src/heap-profile-table.cc +@@ -517,7 +517,7 @@ HeapProfileTable::Snapshot* HeapProfileTable::NonLiveSnapshot( + // Information kept per unique bucket seen + struct HeapProfileTable::Snapshot::Entry { + int count; +- int bytes; ++ size_t bytes; + Bucket* bucket; + Entry() : count(0), bytes(0) { } + +@@ -592,7 +592,7 @@ void HeapProfileTable::Snapshot::ReportLeaks(const char* checker_name, + for (int i = 0; i < to_report; i++) { + const Entry& e = entries[i]; + base::RawPrinter printer(buffer, kBufSize); +- printer.Printf("Leak of %d bytes in %d objects allocated from:\n", ++ printer.Printf("Leak of %zu bytes in %d objects allocated from:\n", + e.bytes, e.count); + for (int j = 0; j < e.bucket->depth; j++) { + const void* pc = e.bucket->stack[j]; +-- +2.27.0 diff --git a/gperftools-2.8.1.tar.gz b/gperftools-2.8.1.tar.gz deleted file mode 100644 index fdbe801..0000000 Binary files a/gperftools-2.8.1.tar.gz and /dev/null differ diff --git a/gperftools-2.9.1.tar.gz b/gperftools-2.9.1.tar.gz new file mode 100644 index 0000000..4704041 Binary files /dev/null and b/gperftools-2.9.1.tar.gz differ diff --git a/gperftools.spec b/gperftools.spec index 78d92a0..e70adf8 100644 --- a/gperftools.spec +++ b/gperftools.spec @@ -1,6 +1,6 @@ Name: gperftools -Version: 2.8.1 -Release: 3 +Version: 2.9.1 +Release: 1 Summary: high-performance malloc and performance analysis tools License: BSD @@ -9,9 +9,10 @@ Source0: https://github.com/gperftools/gperftools/releases/download/%{name}-%{ve patch1: gperftools-generic-dynamic-tls.patch Patch9000: issue-1122-fix-bus-error-on-aarch64.patch #https://github.com/gperftools/gperftools/issues/1309 -Patch9001: skip-arm-in-stacktrace_unittest.patch +#Patch9001: skip-arm-in-stacktrace_unittest.patch #https://github.com/gperftools/gperftools/issues/890 -Patch9002: skip-heapchecker-in-arm-arch.patch +Patch9001: skip-heapchecker-in-arm-arch.patch +Patch9002: avoid-exceed-int-range.patch BuildRequires: autoconf automake gcc-c++ BuildRequires: libtool libunwind-devel perl-generators @@ -106,6 +107,12 @@ LD_LIBRARY_PATH=./.libs make check %{_mandir}/man1/*.1.gz %changelog +* Mon Nov 29 2021 zhangyiru - 2.9.1-1 +- update to 2.9.1 + +* Tue Nov 9 2021 zhangyiru - 2.8.1-4 +- avoid exceed int range when use heapchecker + * Wed Oct 20 2021 zhangyiru - 2.8.1-3 - enable make check && skip four arm testcases. the reason is that arm do not have fully functional heap checker and diff --git a/skip-arm-in-stacktrace_unittest.patch b/skip-arm-in-stacktrace_unittest.patch index 7c28084..7453953 100644 --- a/skip-arm-in-stacktrace_unittest.patch +++ b/skip-arm-in-stacktrace_unittest.patch @@ -1,7 +1,7 @@ -From a4ae4584f8e38fb96ed7adc33231afd19f161e1a Mon Sep 17 00:00:00 2001 +From abf1ed0ce1340320474a4cf3b790b7b741b9a577 Mon Sep 17 00:00:00 2001 From: zhangyiru -Date: Wed, 20 Oct 2021 11:29:09 -0400 -Subject: [PATCH] skip-arm-in-stacktrace_unittest +Date: Mon, 29 Nov 2021 10:35:01 +0800 +Subject: [PATCH] skip stacktrace_unittest in arm the calling of unw_step in arm stacktrace_unittest is incorrect, but the function is not affected, so skip it. @@ -12,10 +12,10 @@ Signed-off-by: zhangyiru 1 file changed, 5 insertions(+) diff --git a/src/tests/stacktrace_unittest.cc b/src/tests/stacktrace_unittest.cc -index 3c9f735..37a90a6 100644 +index e55a632..85c0bcd 100644 --- a/src/tests/stacktrace_unittest.cc +++ b/src/tests/stacktrace_unittest.cc -@@ -188,7 +188,12 @@ void ATTRIBUTE_NOINLINE CheckStackTrace(int i) { +@@ -285,8 +285,13 @@ void ATTRIBUTE_NOINLINE CheckStackTrace(int i) { //-----------------------------------------------------------------------// int main(int argc, char ** argv) { @@ -26,8 +26,9 @@ index 3c9f735..37a90a6 100644 + printf("ARM SKIP\n"); + exit(77); +#endif - return 0; - } + + #if TEST_UCONTEXT_BITS + leaf_capture_fn = CaptureLeafUContext; -- -2.27.0 +1.8.3.1