summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRepository mirror & CI <repomirrorci@gentoo.org>2021-10-25 05:23:29 +0000
committerRepository mirror & CI <repomirrorci@gentoo.org>2021-10-25 05:23:29 +0000
commitfbc486eb27d7f401c8334bd2e3086027bd527e97 (patch)
tree551a5be40785a0671b015eecc10cddb4c7ccb3e5
parent2021-10-25 04:52:04 UTC (diff)
parentdev-libs/elfutils: backport glibc-2.34 test failure patch (diff)
downloadgentoo-fbc486eb27d7f401c8334bd2e3086027bd527e97.tar.gz
gentoo-fbc486eb27d7f401c8334bd2e3086027bd527e97.tar.bz2
gentoo-fbc486eb27d7f401c8334bd2e3086027bd527e97.zip
Merge updates from master
-rw-r--r--dev-libs/elfutils/elfutils-0.185.ebuild1
-rw-r--r--dev-libs/elfutils/files/elfutils-0.185-glibc-2.34-test-failure.patch124
2 files changed, 125 insertions, 0 deletions
diff --git a/dev-libs/elfutils/elfutils-0.185.ebuild b/dev-libs/elfutils/elfutils-0.185.ebuild
index fd5ccd261595..a73fbfc04925 100644
--- a/dev-libs/elfutils/elfutils-0.185.ebuild
+++ b/dev-libs/elfutils/elfutils-0.185.ebuild
@@ -36,6 +36,7 @@ PATCHES=(
"${FILESDIR}"/${PN}-0.185-static-inline.patch
"${FILESDIR}"/${PN}-0.185-pull-advance_pc-in-file-scope.patch
"${FILESDIR}"/${PN}-0.185-configure.ac-rework-gnu99-ext-check-to-allow-clang.patch
+ "${FILESDIR}"/${PN}-0.185-glibc-2.34-test-failure.patch
)
src_prepare() {
diff --git a/dev-libs/elfutils/files/elfutils-0.185-glibc-2.34-test-failure.patch b/dev-libs/elfutils/files/elfutils-0.185-glibc-2.34-test-failure.patch
new file mode 100644
index 000000000000..134e642ab0eb
--- /dev/null
+++ b/dev-libs/elfutils/files/elfutils-0.185-glibc-2.34-test-failure.patch
@@ -0,0 +1,124 @@
+https://sourceware.org/git/?p=elfutils.git;a=commit;h=9aee0992d6e6ec4cce2c015d8da4b61022c6f6dd
+
+Author: Mark Wielaard <mark@klomp.org>
+Date: Wed Aug 4 21:01:27 2021 +0200
+
+ tests: Allow an extra pthread_kill frame in backtrace tests
+
+ glibc 2.34 calls pthread_kill from the raise function. Before raise
+ directly called the (tg)kill syscall. So allow pthread_kill to be the
+ first frame in a backtrace where raise is expected. Also change some
+ asserts to fprintf plus abort to make it more clear why the testcase
+ fails.
+
+ https://sourceware.org/bugzilla/show_bug.cgi?id=28190
+
+ Signed-off-by: Mark Wielaard <mark@klomp.org>
+
+--- a/tests/backtrace.c
++++ b/tests/backtrace.c
+@@ -97,6 +97,9 @@ callback_verify (pid_t tid, unsigned frameno, Dwarf_Addr pc,
+ static bool reduce_frameno = false;
+ if (reduce_frameno)
+ frameno--;
++ static bool pthread_kill_seen = false;
++ if (pthread_kill_seen)
++ frameno--;
+ if (! use_raise_jmp_patching && frameno >= 2)
+ frameno += 2;
+ const char *symname2 = NULL;
+@@ -107,11 +110,26 @@ callback_verify (pid_t tid, unsigned frameno, Dwarf_Addr pc,
+ && (strcmp (symname, "__kernel_vsyscall") == 0
+ || strcmp (symname, "__libc_do_syscall") == 0))
+ reduce_frameno = true;
++ else if (! pthread_kill_seen && symname
++ && strstr (symname, "pthread_kill") != NULL)
++ pthread_kill_seen = true;
+ else
+- assert (symname && strcmp (symname, "raise") == 0);
++ {
++ if (!symname || strcmp (symname, "raise") != 0)
++ {
++ fprintf (stderr,
++ "case 0: expected symname 'raise' got '%s'\n", symname);
++ abort ();
++ }
++ }
+ break;
+ case 1:
+- assert (symname != NULL && strcmp (symname, "sigusr2") == 0);
++ if (symname == NULL || strcmp (symname, "sigusr2") != 0)
++ {
++ fprintf (stderr,
++ "case 1: expected symname 'sigusr2' got '%s'\n", symname);
++ abort ();
++ }
+ break;
+ case 2: // x86_64 only
+ /* __restore_rt - glibc maybe does not have to have this symbol. */
+@@ -120,11 +138,21 @@ callback_verify (pid_t tid, unsigned frameno, Dwarf_Addr pc,
+ if (use_raise_jmp_patching)
+ {
+ /* Verify we trapped on the very first instruction of jmp. */
+- assert (symname != NULL && strcmp (symname, "jmp") == 0);
++ if (symname == NULL || strcmp (symname, "jmp") != 0)
++ {
++ fprintf (stderr,
++ "case 3: expected symname 'raise' got '%s'\n", symname);
++ abort ();
++ }
+ mod = dwfl_addrmodule (dwfl, pc - 1);
+ if (mod)
+ symname2 = dwfl_module_addrname (mod, pc - 1);
+- assert (symname2 == NULL || strcmp (symname2, "jmp") != 0);
++ if (symname2 == NULL || strcmp (symname2, "jmp") != 0)
++ {
++ fprintf (stderr,
++ "case 3: expected symname2 'jmp' got '%s'\n", symname2);
++ abort ();
++ }
+ break;
+ }
+ FALLTHROUGH;
+@@ -137,11 +165,22 @@ callback_verify (pid_t tid, unsigned frameno, Dwarf_Addr pc,
+ duplicate_sigusr2 = true;
+ break;
+ }
+- assert (symname != NULL && strcmp (symname, "stdarg") == 0);
++ if (symname == NULL || strcmp (symname, "stdarg") != 0)
++ {
++ fprintf (stderr,
++ "case 4: expected symname 'stdarg' got '%s'\n", symname);
++ abort ();
++ }
+ break;
+ case 5:
+ /* Verify we trapped on the very last instruction of child. */
+- assert (symname != NULL && strcmp (symname, "backtracegen") == 0);
++ if (symname == NULL || strcmp (symname, "backtracegen") != 0)
++ {
++ fprintf (stderr,
++ "case 5: expected symname 'backtracegen' got '%s'\n",
++ symname);
++ abort ();
++ }
+ mod = dwfl_addrmodule (dwfl, pc);
+ if (mod)
+ symname2 = dwfl_module_addrname (mod, pc);
+@@ -151,7 +190,15 @@ callback_verify (pid_t tid, unsigned frameno, Dwarf_Addr pc,
+ // instructions or even inserts some padding instructions at the end
+ // (which apparently happens on ppc64).
+ if (use_raise_jmp_patching)
+- assert (symname2 == NULL || strcmp (symname2, "backtracegen") != 0);
++ {
++ if (symname2 != NULL && strcmp (symname2, "backtracegen") == 0)
++ {
++ fprintf (stderr,
++ "use_raise_jmp_patching didn't expect symname2 "
++ "'backtracegen'\n");
++ abort ();
++ }
++ }
+ break;
+ }
+ }