Compare commits
No commits in common. "8b2eeab75487263d9e9f2a25b7ebbbc916bc7ee2" and "8dba75199a6fa6f4d80034a712e8a62ea7fe97af" have entirely different histories.
8b2eeab754
...
8dba75199a
33
avoid-exceed-int-range.patch
Normal file
33
avoid-exceed-int-range.patch
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
From 85158d45ec66c34f5903a15c3b74600a925703ef Mon Sep 17 00:00:00 2001
|
||||||
|
From: zhangyiru <zhanguyiru@huawei.com>
|
||||||
|
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
|
||||||
Binary file not shown.
BIN
gperftools-2.9.1.tar.gz
Normal file
BIN
gperftools-2.9.1.tar.gz
Normal file
Binary file not shown.
@ -1,16 +1,18 @@
|
|||||||
Name: gperftools
|
Name: gperftools
|
||||||
Version: 2.15
|
Version: 2.9.1
|
||||||
Release: 2
|
Release: 3
|
||||||
Summary: high-performance malloc and performance analysis tools
|
Summary: high-performance malloc and performance analysis tools
|
||||||
|
|
||||||
License: BSD-3-Clause
|
License: BSD
|
||||||
URL: https://github.com/gperftools/gperftools
|
URL: https://github.com/gperftools/gperftools
|
||||||
Source0: https://github.com/gperftools/gperftools/releases/download/%{name}-%{version}/%{name}-%{version}.tar.gz
|
Source0: https://github.com/gperftools/gperftools/releases/download/%{name}-%{version}/%{name}-%{version}.tar.gz
|
||||||
patch1: gperftools-generic-dynamic-tls.patch
|
patch1: gperftools-generic-dynamic-tls.patch
|
||||||
|
Patch9000: issue-1122-fix-bus-error-on-aarch64.patch
|
||||||
#https://github.com/gperftools/gperftools/issues/1309
|
#https://github.com/gperftools/gperftools/issues/1309
|
||||||
Patch9000: skip-arm-in-stacktrace_unittest.patch
|
#Patch9001: skip-arm-in-stacktrace_unittest.patch
|
||||||
#https://github.com/gperftools/gperftools/issues/890
|
#https://github.com/gperftools/gperftools/issues/890
|
||||||
Patch9001: 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: autoconf automake gcc-c++
|
||||||
BuildRequires: libtool libunwind-devel perl-generators
|
BuildRequires: libtool libunwind-devel perl-generators
|
||||||
@ -68,9 +70,6 @@ CXXFLAGS=`echo $RPM_OPT_FLAGS -fno-strict-aliasing -Wno-unused-local-typedefs -D
|
|||||||
%configure \
|
%configure \
|
||||||
%ifarch s390x aarch64
|
%ifarch s390x aarch64
|
||||||
--disable-general-dynamic-tls \
|
--disable-general-dynamic-tls \
|
||||||
%endif
|
|
||||||
%ifarch riscv64
|
|
||||||
--enable-frame-pointers \
|
|
||||||
%endif
|
%endif
|
||||||
--disable-dynamic-sized-delete-support \
|
--disable-dynamic-sized-delete-support \
|
||||||
|
|
||||||
@ -108,22 +107,6 @@ LD_LIBRARY_PATH=./.libs make check
|
|||||||
%{_mandir}/man1/*.1.gz
|
%{_mandir}/man1/*.1.gz
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Mon Apr 22 2024 laokz <zhangkai@iscas.ac.cn> - 2.15-2
|
|
||||||
- riscv64: force --enable-frame-pointers due to unsupported
|
|
||||||
-momit-leaf-frame-pointer compile option until gcc14
|
|
||||||
|
|
||||||
* Mon Feb 5 2024 nicunshu <nicunshu@huawei.com> - 2.15-1
|
|
||||||
- Upgrade tp 2.15
|
|
||||||
|
|
||||||
* Wed Jul 12 2023 doupengda <doupengda@loongson.cn> - 2.10-3
|
|
||||||
- Resolving loongarch64 build error
|
|
||||||
|
|
||||||
* Wed Aug 03 2022 liukuo <liukuo@kylinos.cn> - 2.10-2
|
|
||||||
- License compliance rectification
|
|
||||||
|
|
||||||
* Tue Jul 19 2022 Qingqing Li <liqingqing3@huawei.com> - 2.10-1
|
|
||||||
- upgrade to 2.10
|
|
||||||
|
|
||||||
* Mon Feb 28 2022 liusirui <liusirui@huawei.com> - 2.9.1-3
|
* Mon Feb 28 2022 liusirui <liusirui@huawei.com> - 2.9.1-3
|
||||||
- remove the dependency of the main package and pprof
|
- remove the dependency of the main package and pprof
|
||||||
|
|
||||||
|
|||||||
42
issue-1122-fix-bus-error-on-aarch64.patch
Normal file
42
issue-1122-fix-bus-error-on-aarch64.patch
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
From 42dbe9e2ced74ae7f0f3b70daabf634edf44d3d3 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Zhipeng Xie <xiezhipeng1@huawei.com>
|
||||||
|
Date: Thu, 13 Jun 2019 23:16:43 +0800
|
||||||
|
Subject: [PATCH] issue-1122: fix bus error on aarch64
|
||||||
|
|
||||||
|
According to the ARMv8 Instruction Set Overview, among other documents,
|
||||||
|
"... if SP is used as the base register then the value of the stack
|
||||||
|
pointer prior to adding any offset must be quadword (16 byte) aligned,
|
||||||
|
or else a stack alignment exception will be generated.". So, we pass
|
||||||
|
the child_stack 16 byte aligned to sys_clone.
|
||||||
|
|
||||||
|
Signed-off-by: Zhipeng Xie <xiezhipeng1@huawei.com>
|
||||||
|
---
|
||||||
|
src/base/linuxthreads.cc | 5 ++++-
|
||||||
|
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/base/linuxthreads.cc b/src/base/linuxthreads.cc
|
||||||
|
index 891e70c..00b1ea3 100644
|
||||||
|
--- a/src/base/linuxthreads.cc
|
||||||
|
+++ b/src/base/linuxthreads.cc
|
||||||
|
@@ -105,6 +105,7 @@ static int local_clone (int (*fn)(void *), void *arg, ...)
|
||||||
|
#define CLONE_STACK_SIZE 4096
|
||||||
|
#endif
|
||||||
|
|
||||||
|
+#define ALIGN(x, a) (((x) + (a) - 1) & ~((a) - 1))
|
||||||
|
static int local_clone (int (*fn)(void *), void *arg, ...) {
|
||||||
|
/* Leave 4kB of gap between the callers stack and the new clone. This
|
||||||
|
* should be more than sufficient for the caller to call waitpid() until
|
||||||
|
@@ -120,7 +121,9 @@ static int local_clone (int (*fn)(void *), void *arg, ...) {
|
||||||
|
* is being debugged. This is OK and the error code will be reported
|
||||||
|
* correctly.
|
||||||
|
*/
|
||||||
|
- return sys_clone(fn, (char *)&arg - CLONE_STACK_SIZE,
|
||||||
|
+ void *child_stack = (void *)ALIGN(((unsigned long)&arg - CLONE_STACK_SIZE),
|
||||||
|
+ 16);
|
||||||
|
+ return sys_clone(fn, child_stack,
|
||||||
|
CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_UNTRACED, arg, 0, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
--
|
||||||
|
1.7.12.4
|
||||||
|
|
||||||
@ -8,23 +8,27 @@ function is not affected, so skip it.
|
|||||||
|
|
||||||
Signed-off-by: zhangyiru <zhangyiru3@huawei.com>
|
Signed-off-by: zhangyiru <zhangyiru3@huawei.com>
|
||||||
---
|
---
|
||||||
src/tests/stacktrace_unittest.cc | 4 ++++
|
src/tests/stacktrace_unittest.cc | 5 +++++
|
||||||
1 file changed, 4 insertions(+)
|
1 file changed, 5 insertions(+)
|
||||||
|
|
||||||
diff --git a/src/tests/stacktrace_unittest.cc b/src/tests/stacktrace_unittest.cc
|
diff --git a/src/tests/stacktrace_unittest.cc b/src/tests/stacktrace_unittest.cc
|
||||||
index 55cb054..85e5916 100644
|
index e55a632..85c0bcd 100644
|
||||||
--- a/src/tests/stacktrace_unittest.cc
|
--- a/src/tests/stacktrace_unittest.cc
|
||||||
+++ b/src/tests/stacktrace_unittest.cc
|
+++ b/src/tests/stacktrace_unittest.cc
|
||||||
@@ -376,6 +376,10 @@ const char* TEST_bump_stacktrace_implementation(const char*);
|
@@ -285,8 +285,13 @@ void ATTRIBUTE_NOINLINE CheckStackTrace(int i) {
|
||||||
}
|
//-----------------------------------------------------------------------//
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char ** argv) {
|
||||||
+#if defined(__aarch64__)
|
+#if defined(__x86_64__)
|
||||||
|
CheckStackTrace(0);
|
||||||
|
printf("PASS\n");
|
||||||
|
+#else
|
||||||
+ printf("ARM SKIP\n");
|
+ printf("ARM SKIP\n");
|
||||||
+ exit(77);
|
+ exit(77);
|
||||||
+#endif
|
+#endif
|
||||||
if (argc > 1 && strcmp(argv[1], "--skip-ucontext") == 0) {
|
|
||||||
argc--;
|
#if TEST_UCONTEXT_BITS
|
||||||
argv--;
|
leaf_capture_fn = CaptureLeafUContext;
|
||||||
--
|
--
|
||||||
2.33.0
|
1.8.3.1
|
||||||
|
|
||||||
|
|||||||
@ -9,8 +9,8 @@ testcases.
|
|||||||
Signed-off-by: zhangyiru <zhangyiru3@huawei.com>
|
Signed-off-by: zhangyiru <zhangyiru3@huawei.com>
|
||||||
---
|
---
|
||||||
src/tests/heap-checker-death_unittest.sh | 5 +++++
|
src/tests/heap-checker-death_unittest.sh | 5 +++++
|
||||||
src/tests/heap-checker_unittest.cc | 4 ++++
|
src/tests/heap-checker_unittest.sh | 5 +++++
|
||||||
2 files changed, 9 insertions(+)
|
2 files changed, 10 insertions(+)
|
||||||
|
|
||||||
diff --git a/src/tests/heap-checker-death_unittest.sh b/src/tests/heap-checker-death_unittest.sh
|
diff --git a/src/tests/heap-checker-death_unittest.sh b/src/tests/heap-checker-death_unittest.sh
|
||||||
index 69db0c9..deac493 100755
|
index 69db0c9..deac493 100755
|
||||||
@ -28,20 +28,22 @@ index 69db0c9..deac493 100755
|
|||||||
# We expect BINDIR to be set in the environment.
|
# We expect BINDIR to be set in the environment.
|
||||||
# If not, we set it to some reasonable value.
|
# If not, we set it to some reasonable value.
|
||||||
BINDIR="${BINDIR:-.}"
|
BINDIR="${BINDIR:-.}"
|
||||||
diff --git a/src/tests/heap-checker_unittest.cc b/src/tests/heap-checker_unittest.cc
|
diff --git a/src/tests/heap-checker_unittest.sh b/src/tests/heap-checker_unittest.sh
|
||||||
index 9a7086c..be483fe 100644
|
index 3c9c0e9..7c27044 100755
|
||||||
--- a/src/tests/heap-checker_unittest.cc
|
--- a/src/tests/heap-checker_unittest.sh
|
||||||
+++ b/src/tests/heap-checker_unittest.cc
|
+++ b/src/tests/heap-checker_unittest.sh
|
||||||
@@ -1412,6 +1412,10 @@ bool spawn_subtest(const char* mode, char** argv) {
|
@@ -37,6 +37,11 @@
|
||||||
}
|
# and heap checker via environment variables. This test makes sure
|
||||||
|
# they all play well together.
|
||||||
int main(int argc, char** argv) {
|
|
||||||
+#if defined(__aarch64__)
|
|
||||||
+ printf("ARM SKIP\n");
|
|
||||||
+ exit(77);
|
|
||||||
+#endif
|
|
||||||
if (getenv("HEAPCHECK") == nullptr) {
|
|
||||||
CHECK(!HeapLeakChecker::IsActive());
|
|
||||||
|
|
||||||
|
+arch=$(uname -r | grep x86)
|
||||||
|
+if [[ $arch == "" ]]; then
|
||||||
|
+# skip this test, libtool define EXIT_SKIP=77
|
||||||
|
+ exit 77
|
||||||
|
+fi
|
||||||
|
# We expect BINDIR and PPROF_PATH to be set in the environment.
|
||||||
|
# If not, we set them to some reasonable values
|
||||||
|
BINDIR="${BINDIR:-.}"
|
||||||
--
|
--
|
||||||
2.33.0
|
2.27.0
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user