diff --git a/backport-avoid-calling-printf-because-OE-glibc-2.34-used-mno-.patch b/backport-avoid-calling-printf-because-OE-glibc-2.34-used-mno-.patch new file mode 100644 index 0000000000000000000000000000000000000000..b8c7dec55d62fb9d47112b0b7768abd751c40780 --- /dev/null +++ b/backport-avoid-calling-printf-because-OE-glibc-2.34-used-mno-.patch @@ -0,0 +1,46 @@ +From ffb69e2384538a7d4b634bdc491d7da9b7220f57 Mon Sep 17 00:00:00 2001 +From: chenziyang +Date: Tue, 11 Jul 2023 10:19:22 +0800 +Subject: [PATCH] avoid calling printf because OE glibc-2.34 used + -mno-outline-atomics buildflag, it will cause printf to be non-atomic + operations on ARMv8.1 platform. This will cause printf to stuck into dead + loop because ptrace sing-step execution cause race condition during printf + instructions. + +--- + tests/mapper.c | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/tests/mapper.c b/tests/mapper.c +index b47ae78..fcfb080 100644 +--- a/tests/mapper.c ++++ b/tests/mapper.c +@@ -43,6 +43,15 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + # define MAP_NORESERVE 0 + #endif + ++void __attribute__((noinline)) push_some_stacks(int n) ++{ ++ if (n >= 1) ++ { ++ push_some_stacks(n - 1); ++ push_some_stacks(n - 1); ++ } ++} ++ + int + main (void) + { +@@ -71,7 +80,7 @@ main (void) + + printf ("Turning on single-stepping...\n"); + kill (getpid (), SIGUSR1); /* tell test-ptrace to start single-stepping */ +- printf ("Va bene?\n"); ++ push_some_stacks (4); + kill (getpid (), SIGUSR2); /* tell test-ptrace to stop single-stepping */ + printf ("Turned single-stepping off...\n"); + return 0; +-- +2.33.0 + + diff --git a/backport-fix-run-ptrace-mapper-test-case-failed.patch b/backport-fix-run-ptrace-mapper-test-case-failed.patch new file mode 100644 index 0000000000000000000000000000000000000000..9268239a3225acedb383604a6a63247d607e687b --- /dev/null +++ b/backport-fix-run-ptrace-mapper-test-case-failed.patch @@ -0,0 +1,28 @@ +From 0224ac01f620ff226bdf877e2b278d20c0fa1b56 Mon Sep 17 00:00:00 2001 +From: chenziyang +Date: Mon, 3 Jul 2023 14:27:47 +0800 +Subject: [PATCH] Fix run-ptrace-mapper test case failed by allowing + unw_get_proc_info() return unsuccessful result. Because it is not an error + unw_get_proc_info() does not return the auxiliary information, so we edit + test case and don't treat it as error. + +--- + tests/test-ptrace.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/test-ptrace.c b/tests/test-ptrace.c +index 846bcd8..32f42e8 100644 +--- a/tests/test-ptrace.c ++++ b/tests/test-ptrace.c +@@ -111,7 +111,7 @@ do_backtrace (void) + printf ("%016lx %-32s (sp=%016lx)\n", (long) ip, buf, (long) sp); + } + +- if ((ret = unw_get_proc_info (&c, &pi)) < 0) ++ if ((ret = unw_get_proc_info (&c, &pi)) < 0 && ret != -UNW_ENOINFO) /* It's possible unw_get_proc_info don't return infomation */ + panic ("unw_get_proc_info(ip=0x%lx) failed: ret=%d\n", (long) ip, ret); + else if (verbose) + printf ("\tproc=%016lx-%016lx\n\thandler=%lx lsda=%lx", +-- +2.33.0 + diff --git a/libunwind.spec b/libunwind.spec index 1c41200e19d02301499b73f65ffcaeed26c65344..2eaac817ddd4aba330679a622f417219508c0506 100644 --- a/libunwind.spec +++ b/libunwind.spec @@ -1,7 +1,7 @@ Name: libunwind Epoch: 2 Version: 1.3.1 -Release: 5 +Release: 6 Summary: Libunwind provides a C ABI to determine the call-chain of a program License: BSD URL: http://savannah.nongnu.org/projects/libunwind @@ -19,6 +19,8 @@ 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 +Patch6012: backport-avoid-calling-printf-because-OE-glibc-2.34-used-mno-.patch +Patch6013: backport-fix-run-ptrace-mapper-test-case-failed.patch ExclusiveArch: aarch64 %{ix86} x86_64 @@ -96,6 +98,12 @@ make check || true %{_mandir}/*/* %changelog +* Tue Jul 11 2023 chenziyang - 2:1.3.1-6 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:backport upstream patch to fix failed run-ptrace-mapper testcase + * Tue Feb 21 2021 shixuantong - 2:1.3.1-5 - fix some test fail