fix some test fail
(cherry picked from commit f7bb07bf881c2885f30be53b6751734a89c9b215)
This commit is contained in:
parent
7fffc7fdb3
commit
57d05dd4a5
@ -0,0 +1,81 @@
|
|||||||
|
From 62de804cb8f20a7cd6933a2fcf7b3394fec103de Mon Sep 17 00:00:00 2001
|
||||||
|
From: Zhaofeng Li <hello@zhaofeng.li>
|
||||||
|
Date: Sun, 27 Jun 2021 18:40:24 +0000
|
||||||
|
Subject: [PATCH] Ltest-mem-validate: Disable inlining for consume_and_run
|
||||||
|
|
||||||
|
See #222 and #227. The tests are so fragile :(
|
||||||
|
---
|
||||||
|
tests/Ltest-mem-validate.c | 22 ++++++++++++++++++----
|
||||||
|
1 file changed, 18 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/tests/Ltest-mem-validate.c b/tests/Ltest-mem-validate.c
|
||||||
|
index 1cacb9f..ac12dec 100644
|
||||||
|
--- a/tests/Ltest-mem-validate.c
|
||||||
|
+++ b/tests/Ltest-mem-validate.c
|
||||||
|
@@ -45,8 +45,11 @@ void * stack_start;
|
||||||
|
|
||||||
|
void do_backtrace (void)
|
||||||
|
{
|
||||||
|
- void* buffer[1024];
|
||||||
|
- int size = 1024;
|
||||||
|
+ /*
|
||||||
|
+ We make the assumption that we are able to rewind far enough
|
||||||
|
+ (steps > 5) before touching the forbidden region in the stack,
|
||||||
|
+ at which point the unwinding should stop gracefully.
|
||||||
|
+ */
|
||||||
|
mprotect((void*)((uintptr_t)stack_start & ~(PAGE_SIZE - 1)),
|
||||||
|
PAGE_SIZE, PROT_NONE);
|
||||||
|
|
||||||
|
@@ -66,6 +69,7 @@ void do_backtrace (void)
|
||||||
|
unw_get_reg (&cursor, UNW_REG_SP, &sp);
|
||||||
|
|
||||||
|
ret = unw_step (&cursor);
|
||||||
|
+ printf("ip=%lx, sp=%lx -> %d\n", ip, sp, ret);
|
||||||
|
if (ret < 0)
|
||||||
|
{
|
||||||
|
unw_get_reg (&cursor, UNW_REG_IP, &ip);
|
||||||
|
@@ -76,14 +80,16 @@ void do_backtrace (void)
|
||||||
|
|
||||||
|
if (steps < 5)
|
||||||
|
{
|
||||||
|
+ printf("not enough steps: %d, need 5\n", steps);
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
+ printf("success, steps: %d\n", steps);
|
||||||
|
|
||||||
|
mprotect((void*)((uintptr_t)stack_start & ~(PAGE_SIZE - 1)),
|
||||||
|
PAGE_SIZE, PROT_READ|PROT_WRITE);
|
||||||
|
}
|
||||||
|
|
||||||
|
-void consume_and_run (int depth)
|
||||||
|
+void NOINLINE consume_and_run (int depth)
|
||||||
|
{
|
||||||
|
unw_cursor_t cursor;
|
||||||
|
unw_context_t uc;
|
||||||
|
@@ -106,6 +112,14 @@ main (int argc, char **argv UNUSED)
|
||||||
|
|
||||||
|
stack_start = &start;
|
||||||
|
|
||||||
|
+ /*
|
||||||
|
+ We need to make the frame at least the size protected by
|
||||||
|
+ the mprotect call so we are not forbidding access to
|
||||||
|
+ unrelated regions.
|
||||||
|
+ */
|
||||||
|
+ char string[PAGE_SIZE];
|
||||||
|
+ sprintf (string, "hello\n");
|
||||||
|
+
|
||||||
|
// Initialize pipe mem validate check, opens file descriptors
|
||||||
|
unw_getcontext(&uc);
|
||||||
|
if (unw_init_local (&cursor, &uc) < 0)
|
||||||
|
@@ -119,7 +133,7 @@ main (int argc, char **argv UNUSED)
|
||||||
|
if (!childpid)
|
||||||
|
{
|
||||||
|
/* Close fds and make sure we still work */
|
||||||
|
- int ret = close(i);
|
||||||
|
+ close(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
int status;
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
102
backport-check-namespace.sh-adjust-aarch64-symbols.patch
Normal file
102
backport-check-namespace.sh-adjust-aarch64-symbols.patch
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
From e8fa8d0ca5349d01cf5505eb0d952ef26c62cc94 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Stephen Webb <swebb@blackberry.com>
|
||||||
|
Date: Fri, 21 Oct 2022 15:52:22 -0400
|
||||||
|
Subject: [PATCH] check-namespace.sh: adjust aarch64 symbols
|
||||||
|
|
||||||
|
Some symbols for aarch64 were missing, and some were marked as
|
||||||
|
extraneous in this ABI checker.
|
||||||
|
|
||||||
|
Fixes #389.
|
||||||
|
---
|
||||||
|
tests/check-namespace.sh.in | 26 +++++++++++---------------
|
||||||
|
1 file changed, 11 insertions(+), 15 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/tests/check-namespace.sh.in b/tests/check-namespace.sh.in
|
||||||
|
index 6d00817..d449a83 100644
|
||||||
|
--- a/tests/check-namespace.sh.in
|
||||||
|
+++ b/tests/check-namespace.sh.in
|
||||||
|
@@ -112,7 +112,8 @@ check_local_unw_abi () {
|
||||||
|
|
||||||
|
match _U${plat}_flush_cache
|
||||||
|
match _U${plat}_get_accessors
|
||||||
|
- match _U${plat}_getcontext
|
||||||
|
+ match _U${plat}_get_elf_image
|
||||||
|
+ match _U${plat}_get_exe_image_path
|
||||||
|
match _U${plat}_regname
|
||||||
|
match _U${plat}_strerror
|
||||||
|
|
||||||
|
@@ -125,55 +126,48 @@ check_local_unw_abi () {
|
||||||
|
|
||||||
|
case ${plat} in
|
||||||
|
arm)
|
||||||
|
- match _U${plat}_get_elf_image
|
||||||
|
- match _U${plat}_get_exe_image_path
|
||||||
|
+ match _U${plat}_getcontext
|
||||||
|
match _U${plat}_is_fpreg
|
||||||
|
match _UL${plat}_search_unwind_table
|
||||||
|
match _UL${plat}_dwarf_search_unwind_table
|
||||||
|
match _UL${plat}_dwarf_find_unwind_table
|
||||||
|
;;
|
||||||
|
hppa)
|
||||||
|
+ match _U${plat}_getcontext
|
||||||
|
match _UL${plat}_dwarf_search_unwind_table
|
||||||
|
match _UL${plat}_dwarf_find_unwind_table
|
||||||
|
- match _U${plat}_get_elf_image
|
||||||
|
- match _U${plat}_get_exe_image_path
|
||||||
|
match _U${plat}_setcontext
|
||||||
|
;;
|
||||||
|
ia64)
|
||||||
|
+ match _U${plat}_getcontext
|
||||||
|
match _UL${plat}_search_unwind_table
|
||||||
|
- match _U${plat}_get_elf_image
|
||||||
|
- match _U${plat}_get_exe_image_path
|
||||||
|
;;
|
||||||
|
x86)
|
||||||
|
- match _U${plat}_get_elf_image
|
||||||
|
- match _U${plat}_get_exe_image_path
|
||||||
|
+ match _U${plat}_getcontext
|
||||||
|
match _U${plat}_is_fpreg
|
||||||
|
match _UL${plat}_dwarf_search_unwind_table
|
||||||
|
match _UL${plat}_dwarf_find_unwind_table
|
||||||
|
;;
|
||||||
|
x86_64)
|
||||||
|
- match _U${plat}_get_elf_image
|
||||||
|
- match _U${plat}_get_exe_image_path
|
||||||
|
+ match _U${plat}_getcontext
|
||||||
|
match _U${plat}_is_fpreg
|
||||||
|
match _UL${plat}_dwarf_search_unwind_table
|
||||||
|
match _UL${plat}_dwarf_find_unwind_table
|
||||||
|
match _U${plat}_setcontext
|
||||||
|
;;
|
||||||
|
ppc*)
|
||||||
|
+ match _U${plat}_getcontext
|
||||||
|
match _U${plat}_get_func_addr
|
||||||
|
- match _U${plat}_get_elf_image
|
||||||
|
- match _U${plat}_get_exe_image_path
|
||||||
|
match _U${plat}_is_fpreg
|
||||||
|
match _UL${plat}_dwarf_search_unwind_table
|
||||||
|
match _UL${plat}_dwarf_find_unwind_table
|
||||||
|
;;
|
||||||
|
tilegx)
|
||||||
|
+ match _U${plat}_getcontext
|
||||||
|
match _U${plat}_is_fpreg
|
||||||
|
match _UL${plat}_dwarf_search_unwind_table
|
||||||
|
match _UL${plat}_dwarf_find_unwind_table
|
||||||
|
match _UL${plat}_local_addr_space_init
|
||||||
|
- match _U${plat}_get_elf_image
|
||||||
|
- match _U${plat}_get_exe_image_path
|
||||||
|
match ${plat}_lock
|
||||||
|
;;
|
||||||
|
|
||||||
|
@@ -280,6 +274,8 @@ check_generic_unw_abi () {
|
||||||
|
match _U${plat}_is_fpreg
|
||||||
|
match _U${plat}_dwarf_search_unwind_table
|
||||||
|
match _U${plat}_dwarf_find_unwind_table
|
||||||
|
+ match _U${plat}_get_elf_image
|
||||||
|
+ match _U${plat}_get_exe_image_path
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
@ -0,0 +1,31 @@
|
|||||||
|
From fedff5ac77c945fc0c5df534074163a784bfa5b3 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Florian Weimer <fweimer@redhat.com>
|
||||||
|
Date: Wed, 7 Sep 2022 14:01:36 +0200
|
||||||
|
Subject: [PATCH] tests/run-coredump-unwind: Skip test if no coredump has been
|
||||||
|
created
|
||||||
|
|
||||||
|
In some build environments, coredumps are not created even if the
|
||||||
|
corresponding ulimit is positive. This change skips the test if
|
||||||
|
the coredump is missing.
|
||||||
|
---
|
||||||
|
tests/run-coredump-unwind | 4 ++++
|
||||||
|
1 file changed, 4 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/tests/run-coredump-unwind b/tests/run-coredump-unwind
|
||||||
|
index 8d07742..0c2b28c 100755
|
||||||
|
--- a/tests/run-coredump-unwind
|
||||||
|
+++ b/tests/run-coredump-unwind
|
||||||
|
@@ -48,6 +48,10 @@ fi
|
||||||
|
./crasher backing_files
|
||||||
|
) 2>/dev/null
|
||||||
|
COREFILE=$TEMPDIR/core*
|
||||||
|
+if ! test -f "$COREFILE"; then
|
||||||
|
+ echo "crasher process did not produce coredump, test skipped"
|
||||||
|
+ exit 77
|
||||||
|
+fi
|
||||||
|
|
||||||
|
# magic option -testcase enables checking for the specific contents of the stack
|
||||||
|
./test-coredump-unwind $COREFILE -testcase `cat $TEMPDIR/backing_files`
|
||||||
|
--
|
||||||
|
2.33.0
|
||||||
|
|
||||||
@ -1,7 +1,7 @@
|
|||||||
Name: libunwind
|
Name: libunwind
|
||||||
Epoch: 2
|
Epoch: 2
|
||||||
Version: 1.3.1
|
Version: 1.3.1
|
||||||
Release: 4
|
Release: 5
|
||||||
Summary: Libunwind provides a C ABI to determine the call-chain of a program
|
Summary: Libunwind provides a C ABI to determine the call-chain of a program
|
||||||
License: BSD
|
License: BSD
|
||||||
URL: http://savannah.nongnu.org/projects/libunwind
|
URL: http://savannah.nongnu.org/projects/libunwind
|
||||||
@ -16,6 +16,9 @@ Patch6005: Also-define-NLGA-when-we-build-with-atomic-ops-80.patch
|
|||||||
Patch6006: aarch-v2-aarch64-PLT-entry-recognition-fixes-86.patch
|
Patch6006: aarch-v2-aarch64-PLT-entry-recognition-fixes-86.patch
|
||||||
Patch6007: dwarf-Add-missing-opcodes-to-the-operands-table-in-G.patch
|
Patch6007: dwarf-Add-missing-opcodes-to-the-operands-table-in-G.patch
|
||||||
Patch6008: dwarf-Push-correct-CFA-onto-stack-for-dwarf-expressi.patch
|
Patch6008: dwarf-Push-correct-CFA-onto-stack-for-dwarf-expressi.patch
|
||||||
|
Patch6009: backport-check-namespace.sh-adjust-aarch64-symbols.patch
|
||||||
|
Patch6010: backport-Ltest-mem-validate-Disable-inlining-for-consume_and_.patch
|
||||||
|
Patch6011: backport-tests-run-coredump-unwind-Skip-test-if-no-coredump-h.patch
|
||||||
|
|
||||||
ExclusiveArch: aarch64 %{ix86} x86_64
|
ExclusiveArch: aarch64 %{ix86} x86_64
|
||||||
|
|
||||||
@ -65,7 +68,6 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/libunwind-ptrace*.so*
|
|||||||
touch -r NEWS $RPM_BUILD_ROOT%{_includedir}/libunwind.h
|
touch -r NEWS $RPM_BUILD_ROOT%{_includedir}/libunwind.h
|
||||||
|
|
||||||
%check
|
%check
|
||||||
#make check may wrong
|
|
||||||
make check || true
|
make check || true
|
||||||
|
|
||||||
%pre
|
%pre
|
||||||
@ -94,6 +96,9 @@ make check || true
|
|||||||
%{_mandir}/*/*
|
%{_mandir}/*/*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Feb 21 2021 shixuantong <shixuantong1@huawei.com> - 2:1.3.1-5
|
||||||
|
- fix some test fail
|
||||||
|
|
||||||
* Wed Aug 31 2022 yanglongkang <yanglongkang@h-partners.com> - 2:1.3.1-4
|
* Wed Aug 31 2022 yanglongkang <yanglongkang@h-partners.com> - 2:1.3.1-4
|
||||||
- add Epoch in spec file
|
- add Epoch in spec file
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user