summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2015-05-21 08:28:26 +0000
committerMike Frysinger <vapier@gentoo.org>2015-05-21 08:28:26 +0000
commit87b0d02c4a4ed12f557a00d88a23a424686d2152 (patch)
tree14785826aa4c21a82695e342df7f0a8e399bdd1b /sys-libs
parentStable for x86, wrt bug #549760 (diff)
downloadhistorical-87b0d02c4a4ed12f557a00d88a23a424686d2152.tar.gz
historical-87b0d02c4a4ed12f557a00d88a23a424686d2152.tar.bz2
historical-87b0d02c4a4ed12f557a00d88a23a424686d2152.zip
Workaround from Chromium OS for race in signal loop processing.
Package-Manager: portage-2.2.19/cvs/Linux x86_64 Manifest-Sign-Key: 0xD2E96200
Diffstat (limited to 'sys-libs')
-rw-r--r--sys-libs/libnih/ChangeLog8
-rw-r--r--sys-libs/libnih/Manifest30
-rw-r--r--sys-libs/libnih/files/libnih-1.0.3-signal-race.patch60
-rw-r--r--sys-libs/libnih/libnih-1.0.3-r3.ebuild47
4 files changed, 130 insertions, 15 deletions
diff --git a/sys-libs/libnih/ChangeLog b/sys-libs/libnih/ChangeLog
index 3fa5279d16db..b49589bb504b 100644
--- a/sys-libs/libnih/ChangeLog
+++ b/sys-libs/libnih/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for sys-libs/libnih
# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/libnih/ChangeLog,v 1.6 2015/03/05 21:18:32 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/libnih/ChangeLog,v 1.7 2015/05/21 08:28:24 vapier Exp $
+
+*libnih-1.0.3-r3 (21 May 2015)
+
+ 21 May 2015; Mike Frysinger <vapier@gentoo.org>
+ +files/libnih-1.0.3-signal-race.patch, +libnih-1.0.3-r3.ebuild:
+ Workaround from Chromium OS for race in signal loop processing.
*libnih-1.0.3-r2 (05 Mar 2015)
diff --git a/sys-libs/libnih/Manifest b/sys-libs/libnih/Manifest
index 93e90d1320bf..1c1efae6578b 100644
--- a/sys-libs/libnih/Manifest
+++ b/sys-libs/libnih/Manifest
@@ -3,26 +3,28 @@ Hash: SHA256
AUX libnih-1.0.3-optional-dbus.patch 1162 SHA256 93e81914a402ebc512c7df46e00f85b54ed073a66fcf9fe465cb58d757546abf SHA512 bd979f8e9d27d775e12b3a93082084b8837bc9eb4f48476c3356aa4b4f865eda517e6fcf90f5575686dbcdc0fef4a21c640e413d9d3611bb1f1077bfa9fd8c86 WHIRLPOOL 2eb2421f74c9ced344791ab3477035b5e71516962ebfc886f4a21837977854092aec28e68ba81345305f06ee00cf8e466bb5d3863c75d0291c0a9992aba17a6a
AUX libnih-1.0.3-pkg-config.patch 2491 SHA256 cefe32c74c2c23f991e78bb8eaf97da8bcd1b4f252c1aed334e75027568f24d7 SHA512 b99d580f4487cf3d25fa37f3f7b62ce32d9df80c6c0b01ad04b6850215ec0cc24cfea48aaf8ff89afe28db239b5ed212f139e86353d9991152d488c6edce5017 WHIRLPOOL e6a6f4c2d88e4e2da3cbdba8f4b2a43f608ba7e0042f63c6b881653d23a51527d2061bea56924bb624bee5751bea69f4bdc4a206aa32ad62abcf29ea3c6999bc
+AUX libnih-1.0.3-signal-race.patch 2081 SHA256 e7c67f06c0812cabf4f2af05f8d66ecd8819278416f29e7dd6122d9091b6368e SHA512 5367cb0c6382004cc2a829b9b71f0c02a09e4983940afac90c4c5c0bfbda53fb36a6cc7e38ede7a895ce28f99a4f69e89392ebaadefdc536eb7efa90c2426ff8 WHIRLPOOL 2435627ed636ffff2e45b5a2708999a20b88525f438f3382a9acaa08c1ca4b81a7b4d926a6b7930add8c5b692f5790b52af8145cd8a0f8cac8b7f069a7ef4046
DIST libnih-1.0.3.tar.gz 1187624 SHA256 897572df7565c0a90a81532671e23c63f99b4efde2eecbbf11e7857fbc61f405 SHA512 fce40d2445b28c27b8838631681ca3206a4f053b2dd4fc488fc9ef98bbd3d933e3d62b82cf346be2ef1677f6457f692cf5544cd915a6bb1e5c618f98ffa101b4 WHIRLPOOL da001ba05111d3a654e6800cf283e11b5508e53d6d91b37ed277df5a889a1138e90ae13161e0af81bdcac929b105bf889e4dcdc443789f28417c6e3f61530d8c
EBUILD libnih-1.0.3-r1.ebuild 1233 SHA256 3552558603c54a90fd9315dd413021c5c403de754e17a01e9f5a5acab06d7d3f SHA512 2dc0271f4459e93d06d551e57341004fd2c6f286a94015496bbf0885bdfa3b7adf070aaa12e769ff8f2520f2d356bc86032b9ad8b0d7ed10363d4be81681bbc3 WHIRLPOOL 3da3047cf066fbd2e817a8af6a5b070cfab4ef084336f8a6625bb411137400eb6d857473b90553a97f87c8a1d3ed81eaf787d88f54b6aba31af2f0bf43a67af4
EBUILD libnih-1.0.3-r2.ebuild 1264 SHA256 2e5afcce898c113a35c5a592d3cce01bc528d94ca22550fcf9a305dc49998dae SHA512 032efca5141f3cc6a25a32903ae27eb1a90944c6eb1d874f2123d16094b768685fdc2b08e53f5f8bbf2799871f38b40c44a9867b8a1a5ae82cd95c3d5e6b05f7 WHIRLPOOL b0c893a05fecf5e34dec730e89d52c699637a0b19f1353d30419872bcf93c9c687c02483f81e295ce29166b4226578e1ebcca96735c2f8defdc60dc9bb5583d1
+EBUILD libnih-1.0.3-r3.ebuild 1329 SHA256 f71091667f9fc316bc561af5f90b3d5ebed77ed9645fc6521f8ec9c4d5cc539b SHA512 fe547def22a4fa1a5360642427434df9a08db7e73d3e0b2eb219f9ab065ceee81ad79f80e92fb0b3a9a727054ad03907192fb0d822a91a1042b439d1afd67035 WHIRLPOOL 6b8c98a383e9a84d2627f2b60700b811cb164b7eac0b93fbb7f50efc1af0ea4ee46621873eabd66f994b65fb131f106c74c3f516945ba1c5c36f035b1ce3aa44
EBUILD libnih-1.0.3.ebuild 1290 SHA256 7b8e02ef039d4590c4aa8e1164470c8adcf1724212cd96afc154876c5ddd0fe7 SHA512 4d00ac0a17a4cfeb667fc2b5994f17f0f486b8a071ead0db34060b5c48ad8a373da9d9abcdb9d5b5e8ab1f07945b842c76fe77bcb0423108ad9fdb11d8f63a26 WHIRLPOOL 2d51170ce1009e5e940edcb631f90d3e4f666fe97d7a96d3ccbaa6daead2191f74175e69dfe2ba46c1ef50c36e2a01103c544542136779f6946a1a74dd079657
-MISC ChangeLog 1104 SHA256 6a8a6e376618e948112852d9e8e2da5261e939e0309f11ff63b6d8b709509cf0 SHA512 c9faae2fea13aa8ef41d9e9e3e67a1d865d9fb8c2921009ce32a58184af9e84533fe0ed0fdd1bf2169876bb58ac8d96530050908d7859dfc99a61df827ddb2a8 WHIRLPOOL 81fd2dee0c20a7caddbb7bf9c865915eff4ac3a8f52072e752e84adc00366b9a199978a6d046c60170ca62a28e21fce61543dbd42240d065e73585d30fb618f3
+MISC ChangeLog 1319 SHA256 8a3331765ca6aa2bf6f762377b07f96cd81bd6191d7be48d013afe62992fd9f0 SHA512 688f83b3d22960c4048fbd834b052f4f2975dd71745b24df1ca9f82999bb90cea7eb7d4cab1b7824d9d4659c8057660bd5555efd70359154b3240a49dc4ac57f WHIRLPOOL af96b664b92ad80649247f9751822e5f0869e77f419697129420bcce4e87755eb2f41310f43070c82679d44ca3199edd07414363c23d908e24465949a9f8f66d
MISC metadata.xml 265 SHA256 392f5b2c28e89d50960bbd5320bae373a5a33f162ed4ecec8088696aad5d61f2 SHA512 4094e54b19b379b803b6637d2c28188c55c954b7d301e758d7ab1b767f40eadba0e9ea42917a29ddb091dfc45bf31985953553b98f0b379a48a7d240d201fde9 WHIRLPOOL 8416721e7d44aa1fc2434b31fbf4d77024b08544b7e6fd19b74723c357e70c9e1905b083fee97307b331f7016578045ec9467e930980adfc5fdc07d5421465e0
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
-iQIcBAEBCAAGBQJU+MgqAAoJEPGu1DbS6WIAnoYP/RM/wjA05pRMq5f50h5Y4MIK
-g7jlXigDe+LYcpg9A9JFfY6ffhnkSTJMglRgy+KTwwNRiYsWBkDUMnleGJlPYlWU
-Z9Ii+U9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D
+Gnehk2EUbRItx69XwU59WioQrYmgluW9INYaBub5coDejvy87bR/g73jBfw8b5wO
+fg/9fiZbqo9uzd5gfOyy/ZHGQutL3nWEYGoykcWJYVBo5o4jyb75SiDjj27dclV5
+4S38N/Ii5CLbzfvuoM6JMrxTvjqEw7o0ErZ6D/4+7KNbxIYGn6iKoVNer6dx8qir
+hzTm2P3wlyWwmMMLMfDNx4vSCT6gunuuS2taq8/hYKQBILlwwy0wllwU/e9v9kWy
+k3EORFXOCm3mZEhVuofq
+=r/uk
-----END PGP SIGNATURE-----
diff --git a/sys-libs/libnih/files/libnih-1.0.3-signal-race.patch b/sys-libs/libnih/files/libnih-1.0.3-signal-race.patch
new file mode 100644
index 000000000000..4cba5ae4ded3
--- /dev/null
+++ b/sys-libs/libnih/files/libnih-1.0.3-signal-race.patch
@@ -0,0 +1,60 @@
+https://bugs.launchpad.net/libnih/+bug/518921
+
+fix race in signal processing leading to lost signals
+
+The current loop will walk all signals one by one and run the handler
+for it if any signals were pending. Then it clears the array. But if
+a signal comes in for an earlier checked signal, it will get clobbered
+when the final clear runs.
+
+Change the logic so that we only clear entries for signals whose handler
+we explicitly call. If a different signal comes in, we'll process it
+the next time around.
+
+This was discovered & triaged by Jeffy Chen from Rockchip.
+
+=== modified file 'nih/signal.c'
+--- nih/signal.c 2009-06-23 09:29:37 +0000
++++ nih/signal.c 2015-05-21 08:12:11 +0000
+@@ -337,17 +337,37 @@
+
+ nih_signal_init ();
+
++ /* Since this poller runs w/out signals masked, we do not want to try
++ * and clear any other signals (like zeroing the caught array at the
++ * end). If we do that, we open a race:
++ * - Walk the list of signals.
++ * - First one is not set so we move on to the second one.
++ * - First signal comes in while processing second and increments the
++ * caught array entry.
++ * - Finish walking the whole list.
++ * - Zero out the whole list and thus throw away the first signal.
++ * Since the signal handlers can take any length of time, this race
++ * can be open for a variable amount of time.
++ */
++
+ NIH_LIST_FOREACH_SAFE (nih_signals, iter) {
+ NihSignal *signal = (NihSignal *)iter;
+
+ if (! signals_caught[signal->signum])
+ continue;
+
++ /* Now that we know we're going to process this signal, clear
++ * out all pending counts for it. There is a slight race here
++ * where the same signal can come in, but the API has never
++ * guaranteed exact coverage since POSIX does not provide it --
++ * more than one signal can be collapsed into one event. All
++ * we can guarantee is that we'll notice signals that come in
++ * once the handler runs.
++ */
++ signals_caught[signal->signum] = 0;
++
+ signal->handler (signal->data, signal);
+ }
+-
+- for (s = 0; s < NUM_SIGNALS; s++)
+- signals_caught[s] = 0;
+ }
+
+
+
diff --git a/sys-libs/libnih/libnih-1.0.3-r3.ebuild b/sys-libs/libnih/libnih-1.0.3-r3.ebuild
new file mode 100644
index 000000000000..ccd1f5ade940
--- /dev/null
+++ b/sys-libs/libnih/libnih-1.0.3-r3.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/libnih/libnih-1.0.3-r3.ebuild,v 1.1 2015/05/21 08:28:24 vapier Exp $
+
+EAPI="4"
+
+inherit versionator eutils autotools toolchain-funcs multilib flag-o-matic
+
+DESCRIPTION="Light-weight 'standard library' of C functions"
+HOMEPAGE="https://launchpad.net/libnih"
+SRC_URI="http://launchpad.net/${PN}/$(get_version_component_range 1-2)/${PV}/+download/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~mips ~x86"
+IUSE="+dbus nls static-libs test +threads"
+
+RDEPEND="dbus? ( dev-libs/expat >=sys-apps/dbus-1.2.16 )"
+DEPEND="${RDEPEND}
+ sys-devel/gettext
+ virtual/pkgconfig
+ test? ( dev-util/valgrind )"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.0.3-optional-dbus.patch
+ epatch "${FILESDIR}"/${PN}-1.0.3-pkg-config.patch
+ epatch "${FILESDIR}"/${PN}-1.0.3-signal-race.patch
+ eautoreconf
+}
+
+src_configure() {
+ append-lfs-flags
+ econf \
+ $(use_with dbus) \
+ $(use_enable nls) \
+ $(use_enable static-libs static) \
+ $(use_enable threads) \
+ $(use_enable threads threading)
+}
+
+src_install() {
+ default
+
+ # we need to be in / because upstart needs libnih
+ gen_usr_ldscript -a nih $(use dbus && echo nih-dbus)
+ use static-libs || rm "${ED}"/usr/$(get_libdir)/*.la
+}