diff --git a/0001-fix-byte_order_is_valid-function-logic.patch b/0001-fix-byte_order_is_valid-function-logic.patch deleted file mode 100644 index a40375ae6025796983ca375c4f809ebab14465c8..0000000000000000000000000000000000000000 --- a/0001-fix-byte_order_is_valid-function-logic.patch +++ /dev/null @@ -1,31 +0,0 @@ -From dd49933f80043f933bc10e2f0f1c6d3e664475ed Mon Sep 17 00:00:00 2001 -From: hubin -Date: Fri, 16 Dec 2022 09:24:50 +0800 -Subject: [PATCH] fix byte_order_is_valid function logic - -byte_order_is_valid is an inline function extracted from unw_create_addr_space -in libunwind 1.6, currently its logic mismatches the function intention. - -Signed-off-by: hubin ---- - include/libunwind_i.h | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/include/libunwind_i.h b/include/libunwind_i.h -index fea5c26..9742267 100644 ---- a/include/libunwind_i.h -+++ b/include/libunwind_i.h -@@ -119,8 +119,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - static inline int - byte_order_is_valid(int byte_order) - { -- return byte_order != UNW_BIG_ENDIAN -- && byte_order != UNW_LITTLE_ENDIAN; -+ return byte_order == UNW_BIG_ENDIAN -+ || byte_order == UNW_LITTLE_ENDIAN; - } - - static inline int --- -2.33.0 - diff --git a/backport-aarch64-unw_step-validates-address-before-calling-dwarf_get.patch b/backport-aarch64-unw_step-validates-address-before-calling-dwarf_get.patch deleted file mode 100644 index 7be6a50be562faee61324d6b791f7c26ed0e9381..0000000000000000000000000000000000000000 --- a/backport-aarch64-unw_step-validates-address-before-calling-dwarf_get.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 8a0e2fa6579085dc8f51b2bdd90d8b00a2e7d6ab Mon Sep 17 00:00:00 2001 -From: he7850 -Date: Wed, 3 May 2023 15:18:27 +0800 -Subject: [PATCH] aarch64: unw_step() validates address before calling - dwarf_get - -Signed-off-by: he7850 ---- - src/aarch64/Gstep.c | 16 +++++++++++++--- - 1 file changed, 13 insertions(+), 3 deletions(-) - -diff --git a/src/aarch64/Gstep.c b/src/aarch64/Gstep.c -index f4ef369d3..a2ed9bc35 100644 ---- a/src/aarch64/Gstep.c -+++ b/src/aarch64/Gstep.c -@@ -156,18 +156,28 @@ unw_step (unw_cursor_t *cursor) - dwarf_get (&c->dwarf, c->dwarf.loc[UNW_AARCH64_X30], &c->dwarf.ip); - } - -- /* Restore default memory validation state */ -- c->validate = validate; -- - ret = dwarf_step (&c->dwarf); - Debug(1, "dwarf_step()=%d\n", ret); - -+ /* Restore default memory validation state */ -+ c->validate = validate; -+ - if (unlikely (ret == -UNW_ESTOPUNWIND)) - return ret; - - if (unlikely (ret < 0)) - { - /* DWARF failed. */ -+ -+ /* -+ * We could get here because of missing/bad unwind information. -+ * Validate all addresses before dereferencing. -+ */ -+ if (c->dwarf.as == unw_local_addr_space) -+ { -+ c->validate = 1; -+ } -+ - if (is_plt_entry (&c->dwarf)) - { - Debug (2, "found plt entry\n"); - 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 deleted file mode 100644 index b8c7dec55d62fb9d47112b0b7768abd751c40780..0000000000000000000000000000000000000000 --- a/backport-avoid-calling-printf-because-OE-glibc-2.34-used-mno-.patch +++ /dev/null @@ -1,46 +0,0 @@ -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 deleted file mode 100644 index 9268239a3225acedb383604a6a63247d607e687b..0000000000000000000000000000000000000000 --- a/backport-fix-run-ptrace-mapper-test-case-failed.patch +++ /dev/null @@ -1,28 +0,0 @@ -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-1.8.0.tar.gz b/libunwind-1.8.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..73387b239df97aec238917fb295dae3f620d681c Binary files /dev/null and b/libunwind-1.8.0.tar.gz differ diff --git a/libunwind.spec b/libunwind.spec index bbc2463b8a3ebced665d95b8328cdd07a5ef83b1..26c60fd398606485cade50d584214a8917f22c2f 100644 --- a/libunwind.spec +++ b/libunwind.spec @@ -1,16 +1,12 @@ Name: libunwind Epoch: 2 -Version: 1.7.2 -Release: 3 +Version: 1.8.0 +Release: 1 Summary: Libunwind provides a C ABI to determine the call-chain of a program License: BSD URL: http://savannah.nongnu.org/projects/libunwind Source: http://download-mirror.savannah.gnu.org/releases/libunwind/libunwind-%{version}.tar.gz -Patch1: 0001-fix-byte_order_is_valid-function-logic.patch -Patch2: backport-aarch64-unw_step-validates-address-before-calling-dwarf_get.patch -Patch3: backport-avoid-calling-printf-because-OE-glibc-2.34-used-mno-.patch -Patch4: backport-fix-run-ptrace-mapper-test-case-failed.patch Patch9000: riscv.patch ExclusiveArch: aarch64 %{ix86} x86_64 riscv64 ppc64le loongarch64 @@ -89,6 +85,12 @@ make check || true %{_mandir}/*/* %changelog +* Mon Aug 5 2024 dillon chen - 2:1.8.0-1 +- Type: +- ID:NA +- SUG:NA +- DESC:update version to 1.8.0 + * Thu Apr 11 2024 shafeipaozi - 2:1.7.2-3 - add support riscv64