Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/libnih/files/, sys-libs/libnih/
Date: Wed, 20 May 2020 17:43:20
Message-Id: 1589996568.f6fdb2630152ae7803932d9e13cbf1d11183fbae.asturm@gentoo
1 commit: f6fdb2630152ae7803932d9e13cbf1d11183fbae
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Wed May 20 16:55:29 2020 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Wed May 20 17:42:48 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f6fdb263
7
8 sys-libs/libnih: Fix 1/2 broken tests
9
10 Bug: https://bugs.gentoo.org/623930
11 Package-Manager: Portage-2.3.99, Repoman-2.3.22
12 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
13
14 .../libnih/files/libnih-1.0.3-expat-2.2.5.patch | 15 ++++++
15 .../libnih/files/libnih-1.0.3-glibc-2.24.patch | 57 ++++++++++++++++++++++
16 sys-libs/libnih/libnih-1.0.3-r4.ebuild | 10 ++--
17 3 files changed, 78 insertions(+), 4 deletions(-)
18
19 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
20 new file mode 100644
21 index 00000000000..02b5e4c0a9e
22 --- /dev/null
23 +++ b/sys-libs/libnih/files/libnih-1.0.3-expat-2.2.5.patch
24 @@ -0,0 +1,15 @@
25 +Description: Adapt test suite to expat 2.2.5
26 +Author: Axel Beckert <abe@××××××.org>
27 +Bug-Debian: https://bugs.debian.org/886416
28 +
29 +--- a/nih-dbus-tool/tests/test_parse.c
30 ++++ b/nih-dbus-tool/tests/test_parse.c
31 +@@ -7950,7 +7950,7 @@
32 +
33 + TEST_EQ_P (node, NULL);
34 +
35 +- TEST_FILE_EQ (output, ("test:foo:2:0: "
36 ++ TEST_FILE_EQ (output, ("test:foo:1:36: "
37 + "Invalid object path in <node> name attribute\n"));
38 + TEST_FILE_END (output);
39 + TEST_FILE_RESET (output);
40
41 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
42 new file mode 100644
43 index 00000000000..9b90f3539d7
44 --- /dev/null
45 +++ b/sys-libs/libnih/files/libnih-1.0.3-glibc-2.24.patch
46 @@ -0,0 +1,57 @@
47 +With glibc >= 2.24, raise() temporarily blocks signals to make this
48 +function async-signal-safe. This has the consequence that the SIGCONT
49 +signal send by the call to PTRACE_CONT is delivered slightly later. In
50 +turn it means the next ptrace event received is the SIGCONT signal
51 +instead of the expected one.
52 +
53 +Unfortunately the libnih testsuite has very precise expectations, and
54 +do not expect such an event. Fix that by catching it and waiting for the
55 +following event.
56 +
57 +--- libnih-1.0.3.orig/nih/tests/test_child.c
58 ++++ libnih-1.0.3/nih/tests/test_child.c
59 +@@ -360,6 +360,14 @@ test_poll (void)
60 +
61 + waitid (P_PID, pid, &siginfo, WSTOPPED | WNOWAIT);
62 +
63 ++ /* ptrace might catch the SIGCONT emitted with PTRACE_CONT, catch it
64 ++ and wait for the next event.
65 ++ */
66 ++ if (siginfo.si_code == CLD_TRAPPED && siginfo.si_status == SIGCONT) {
67 ++ assert0 (ptrace (PTRACE_CONT, pid, NULL, NULL));
68 ++ waitid (P_PID, pid, &siginfo, WSTOPPED | WNOWAIT);
69 ++ }
70 ++
71 + watch = nih_child_add_watch (NULL, pid, NIH_CHILD_TRAPPED,
72 + my_handler, &watch);
73 +
74 +@@ -420,6 +428,14 @@ test_poll (void)
75 + /* Wait for ptrace to stop the parent (signalling the fork) */
76 + waitid (P_PID, pid, &siginfo, WSTOPPED | WNOWAIT);
77 +
78 ++ /* ptrace might catch the SIGCONT emitted with PTRACE_CONT, catch it
79 ++ and wait for the next event.
80 ++ */
81 ++ if (siginfo.si_code == CLD_TRAPPED && siginfo.si_status == SIGCONT) {
82 ++ assert0 (ptrace (PTRACE_CONT, pid, NULL, NULL));
83 ++ waitid (P_PID, pid, &siginfo, WSTOPPED | WNOWAIT);
84 ++ }
85 ++
86 + /* Will be able to get the child pid now, we have to do it here
87 + * because we want to wait on it to ensure the test is synchronous;
88 + * otherwise nih_child_poll() could actually eat the child event
89 +@@ -489,6 +505,14 @@ test_poll (void)
90 +
91 + waitid (P_PID, pid, &siginfo, WSTOPPED | WNOWAIT);
92 +
93 ++ /* ptrace might catch the SIGCONT emitted with PTRACE_CONT, catch it
94 ++ and wait for the next event.
95 ++ */
96 ++ if (siginfo.si_code == CLD_TRAPPED && siginfo.si_status == SIGCONT) {
97 ++ assert0 (ptrace (PTRACE_CONT, pid, NULL, NULL));
98 ++ waitid (P_PID, pid, &siginfo, WSTOPPED | WNOWAIT);
99 ++ }
100 ++
101 + watch = nih_child_add_watch (NULL, pid, NIH_CHILD_PTRACE,
102 + my_handler, &watch);
103 +
104
105 diff --git a/sys-libs/libnih/libnih-1.0.3-r4.ebuild b/sys-libs/libnih/libnih-1.0.3-r4.ebuild
106 index fae185404cc..e66de55d937 100644
107 --- a/sys-libs/libnih/libnih-1.0.3-r4.ebuild
108 +++ b/sys-libs/libnih/libnih-1.0.3-r4.ebuild
109 @@ -23,10 +23,12 @@ DEPEND="${RDEPEND}
110 sys-devel/gettext
111 virtual/pkgconfig"
112 PATCHES=(
113 - "${FILESDIR}"/${PN}-1.0.3-optional-dbus.patch
114 - "${FILESDIR}"/${PN}-1.0.3-pkg-config.patch
115 - "${FILESDIR}"/${PN}-1.0.3-signal-race.patch
116 - "${FILESDIR}"/${PN}-1.0.3-fno-common.patch
117 + "${FILESDIR}"/${P}-optional-dbus.patch
118 + "${FILESDIR}"/${P}-pkg-config.patch
119 + "${FILESDIR}"/${P}-signal-race.patch
120 + "${FILESDIR}"/${P}-fno-common.patch
121 + "${FILESDIR}"/${P}-expat-2.2.5.patch
122 + "${FILESDIR}"/${P}-glibc-2.24.patch
123 )
124
125 src_prepare() {