public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libnih/files/, sys-libs/libnih/
@ 2020-05-20 17:43 Andreas Sturmlechner
  0 siblings, 0 replies; only message in thread
From: Andreas Sturmlechner @ 2020-05-20 17:43 UTC (permalink / raw
  To: gentoo-commits

commit:     f6fdb2630152ae7803932d9e13cbf1d11183fbae
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Wed May 20 16:55:29 2020 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Wed May 20 17:42:48 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f6fdb263

sys-libs/libnih: Fix 1/2 broken tests

Bug: https://bugs.gentoo.org/623930
Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 .../libnih/files/libnih-1.0.3-expat-2.2.5.patch    | 15 ++++++
 .../libnih/files/libnih-1.0.3-glibc-2.24.patch     | 57 ++++++++++++++++++++++
 sys-libs/libnih/libnih-1.0.3-r4.ebuild             | 10 ++--
 3 files changed, 78 insertions(+), 4 deletions(-)

diff --git a/sys-libs/libnih/files/libnih-1.0.3-expat-2.2.5.patch b/sys-libs/libnih/files/libnih-1.0.3-expat-2.2.5.patch
new file mode 100644
index 00000000000..02b5e4c0a9e
--- /dev/null
+++ b/sys-libs/libnih/files/libnih-1.0.3-expat-2.2.5.patch
@@ -0,0 +1,15 @@
+Description: Adapt test suite to expat 2.2.5
+Author: Axel Beckert <abe@debian.org>
+Bug-Debian: https://bugs.debian.org/886416
+
+--- a/nih-dbus-tool/tests/test_parse.c
++++ b/nih-dbus-tool/tests/test_parse.c
+@@ -7950,7 +7950,7 @@
+ 
+ 		TEST_EQ_P (node, NULL);
+ 
+-		TEST_FILE_EQ (output, ("test:foo:2:0: "
++		TEST_FILE_EQ (output, ("test:foo:1:36: "
+ 				       "Invalid object path in <node> name attribute\n"));
+ 		TEST_FILE_END (output);
+ 		TEST_FILE_RESET (output);

diff --git a/sys-libs/libnih/files/libnih-1.0.3-glibc-2.24.patch b/sys-libs/libnih/files/libnih-1.0.3-glibc-2.24.patch
new file mode 100644
index 00000000000..9b90f3539d7
--- /dev/null
+++ b/sys-libs/libnih/files/libnih-1.0.3-glibc-2.24.patch
@@ -0,0 +1,57 @@
+With glibc >= 2.24, raise() temporarily blocks signals to make this
+function async-signal-safe. This has the consequence that the SIGCONT
+signal send by the call to PTRACE_CONT is delivered slightly later. In
+turn it means the next ptrace event received is the SIGCONT signal
+instead of the expected one.
+
+Unfortunately the libnih testsuite has very precise expectations, and
+do not expect such an event. Fix that by catching it and waiting for the
+following event.
+
+--- libnih-1.0.3.orig/nih/tests/test_child.c
++++ libnih-1.0.3/nih/tests/test_child.c
+@@ -360,6 +360,14 @@ test_poll (void)
+ 
+ 	waitid (P_PID, pid, &siginfo, WSTOPPED | WNOWAIT);
+ 
++	/* ptrace might catch the SIGCONT emitted with PTRACE_CONT, catch it 
++	   and wait for the next event.
++	 */
++	if (siginfo.si_code == CLD_TRAPPED && siginfo.si_status == SIGCONT) {
++		assert0 (ptrace (PTRACE_CONT, pid, NULL, NULL));
++		waitid (P_PID, pid, &siginfo, WSTOPPED | WNOWAIT);
++	}
++
+ 	watch = nih_child_add_watch (NULL, pid, NIH_CHILD_TRAPPED,
+ 				     my_handler, &watch);
+ 
+@@ -420,6 +428,14 @@ test_poll (void)
+ 	/* Wait for ptrace to stop the parent (signalling the fork) */
+ 	waitid (P_PID, pid, &siginfo, WSTOPPED | WNOWAIT);
+ 
++	/* ptrace might catch the SIGCONT emitted with PTRACE_CONT, catch it
++	   and wait for the next event.
++	 */
++	if (siginfo.si_code == CLD_TRAPPED && siginfo.si_status == SIGCONT) {
++		assert0 (ptrace (PTRACE_CONT, pid, NULL, NULL));
++		waitid (P_PID, pid, &siginfo, WSTOPPED | WNOWAIT);
++	}
++
+ 	/* Will be able to get the child pid now, we have to do it here
+ 	 * because we want to wait on it to ensure the test is synchronous;
+ 	 * otherwise nih_child_poll() could actually eat the child event
+@@ -489,6 +505,14 @@ test_poll (void)
+ 
+ 	waitid (P_PID, pid, &siginfo, WSTOPPED | WNOWAIT);
+ 
++	/* ptrace might catch the SIGCONT emitted with PTRACE_CONT, catch it
++	   and wait for the next event.
++	 */
++	if (siginfo.si_code == CLD_TRAPPED && siginfo.si_status == SIGCONT) {
++		assert0 (ptrace (PTRACE_CONT, pid, NULL, NULL));
++		waitid (P_PID, pid, &siginfo, WSTOPPED | WNOWAIT);
++	}
++
+ 	watch = nih_child_add_watch (NULL, pid, NIH_CHILD_PTRACE,
+ 				     my_handler, &watch);
+ 

diff --git a/sys-libs/libnih/libnih-1.0.3-r4.ebuild b/sys-libs/libnih/libnih-1.0.3-r4.ebuild
index fae185404cc..e66de55d937 100644
--- a/sys-libs/libnih/libnih-1.0.3-r4.ebuild
+++ b/sys-libs/libnih/libnih-1.0.3-r4.ebuild
@@ -23,10 +23,12 @@ DEPEND="${RDEPEND}
 	sys-devel/gettext
 	virtual/pkgconfig"
 PATCHES=(
-	"${FILESDIR}"/${PN}-1.0.3-optional-dbus.patch
-	"${FILESDIR}"/${PN}-1.0.3-pkg-config.patch
-	"${FILESDIR}"/${PN}-1.0.3-signal-race.patch
-	"${FILESDIR}"/${PN}-1.0.3-fno-common.patch
+	"${FILESDIR}"/${P}-optional-dbus.patch
+	"${FILESDIR}"/${P}-pkg-config.patch
+	"${FILESDIR}"/${P}-signal-race.patch
+	"${FILESDIR}"/${P}-fno-common.patch
+	"${FILESDIR}"/${P}-expat-2.2.5.patch
+	"${FILESDIR}"/${P}-glibc-2.24.patch
 )
 
 src_prepare() {


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-05-20 17:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-20 17:43 [gentoo-commits] repo/gentoo:master commit in: sys-libs/libnih/files/, sys-libs/libnih/ Andreas Sturmlechner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox