From dc8290ce0bb1f13c42bc002f527c545730a2448b Mon Sep 17 00:00:00 2001 From: Daniel Gryniewicz Date: Thu, 22 Mar 2007 20:22:19 +0000 Subject: [PATCH] Fix 100% cpu usage; bug #171300 Package-Manager: portage-2.1.2.2 --- media-sound/esound/ChangeLog | 6 +- media-sound/esound/Manifest | 25 ++++-- media-sound/esound/esound-0.2.37-r1.ebuild | 86 +++++++++++++++++++ .../esound/files/digest-esound-0.2.37-r1 | 3 + .../files/esound-0.2.37-cpu-drain.patch | 21 +++++ 5 files changed, 133 insertions(+), 8 deletions(-) create mode 100644 media-sound/esound/esound-0.2.37-r1.ebuild create mode 100644 media-sound/esound/files/digest-esound-0.2.37-r1 create mode 100644 media-sound/esound/files/esound-0.2.37-cpu-drain.patch diff --git a/media-sound/esound/ChangeLog b/media-sound/esound/ChangeLog index ee546d306170..76c118a4ea8d 100644 --- a/media-sound/esound/ChangeLog +++ b/media-sound/esound/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for media-sound/esound # Copyright 2002-2007 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/media-sound/esound/ChangeLog,v 1.93 2007/03/19 18:53:21 dang Exp $ +# $Header: /var/cvsroot/gentoo-x86/media-sound/esound/ChangeLog,v 1.94 2007/03/22 20:22:19 dang Exp $ + + 22 Mar 2007; Daniel Gryniewicz + +files/esound-0.2.37-cpu-drain.patch: + Fix 100% cpu usage; bug #171300 19 Mar 2007; Daniel Gryniewicz +files/esound-0.2.37-debug.patch, esound-0.2.37.ebuild: diff --git a/media-sound/esound/Manifest b/media-sound/esound/Manifest index 38f9c07e9775..c25f199fb9e4 100644 --- a/media-sound/esound/Manifest +++ b/media-sound/esound/Manifest @@ -17,6 +17,10 @@ AUX esound-0.2.36-ppc-macos.patch 4067 RMD160 7c7cc864b14df4e3ce38ecacaf3607890e MD5 defad2b109b564a607b57788a05e139d files/esound-0.2.36-ppc-macos.patch 4067 RMD160 7c7cc864b14df4e3ce38ecacaf3607890efb1e61 files/esound-0.2.36-ppc-macos.patch 4067 SHA256 de559ed0dff54fb7746ae7aabee60d8e3815b6c60f09509737dbaec5cde07c97 files/esound-0.2.36-ppc-macos.patch 4067 +AUX esound-0.2.37-cpu-drain.patch 844 RMD160 fd01d6fa423aa0077495c0d315f37fe7a82035c3 SHA1 0e537a71d10d66d4455652e5af159f497825f8bb SHA256 04f6f5d06d930951aeac4843de5fc68983d78234844e02bbf8ff7b38a851552e +MD5 5a96528cf27ba23bb0452858ab9fc305 files/esound-0.2.37-cpu-drain.patch 844 +RMD160 fd01d6fa423aa0077495c0d315f37fe7a82035c3 files/esound-0.2.37-cpu-drain.patch 844 +SHA256 04f6f5d06d930951aeac4843de5fc68983d78234844e02bbf8ff7b38a851552e files/esound-0.2.37-cpu-drain.patch 844 AUX esound-0.2.37-debug.patch 846 RMD160 7005e42b4927b6c5a4f30d4e873c770748e09e2f SHA1 ae214c89066332aa6746aa35fa77160068ed0cc4 SHA256 ca7b64f70b085f83bb16b822d56ceeb77cfe6257d373cb104aea159455c5bacb MD5 a144261a56102548893d1276ff6ce3ff files/esound-0.2.37-debug.patch 846 RMD160 7005e42b4927b6c5a4f30d4e873c770748e09e2f files/esound-0.2.37-debug.patch 846 @@ -43,14 +47,18 @@ EBUILD esound-0.2.36-r2.ebuild 2064 RMD160 725e574ff9471c0c5c91256d4cb33e091263d MD5 44636a5ea87de80085ec35335b8a0f38 esound-0.2.36-r2.ebuild 2064 RMD160 725e574ff9471c0c5c91256d4cb33e091263d675 esound-0.2.36-r2.ebuild 2064 SHA256 5d489c8dec511ce8c0e43a24c39f1c52f448679d42d6898408c24cfd8599dc3b esound-0.2.36-r2.ebuild 2064 +EBUILD esound-0.2.37-r1.ebuild 2298 RMD160 f31e2795365cd54f8df47ff5ca583d0f1137ba2d SHA1 7fc9facf67f2067fbf4fb2356c47ae41d7f64ce0 SHA256 f6f37b45a63cce5a686546c41632c64e515079325d60f166e3aa14e10d7ac6ba +MD5 1e74acca799b5ab509e1e054821b32a0 esound-0.2.37-r1.ebuild 2298 +RMD160 f31e2795365cd54f8df47ff5ca583d0f1137ba2d esound-0.2.37-r1.ebuild 2298 +SHA256 f6f37b45a63cce5a686546c41632c64e515079325d60f166e3aa14e10d7ac6ba esound-0.2.37-r1.ebuild 2298 EBUILD esound-0.2.37.ebuild 2178 RMD160 8edafa45510068b1cbe0f939fb293df082ccd6ce SHA1 1c2d9417386aef2c5eb4f49648817b2e7f39d881 SHA256 5140978145433a296e9bb8848f32e69ed0a8b8950511a4fbb8753cd3a2af425b MD5 0c958d63c5f42cbbfe5cc7fdf9045c30 esound-0.2.37.ebuild 2178 RMD160 8edafa45510068b1cbe0f939fb293df082ccd6ce esound-0.2.37.ebuild 2178 SHA256 5140978145433a296e9bb8848f32e69ed0a8b8950511a4fbb8753cd3a2af425b esound-0.2.37.ebuild 2178 -MISC ChangeLog 12277 RMD160 6987f3c3e55d02c6513cc124b6855c53f66bf4ea SHA1 31ed11a4e7e7dc2999c88edbbb4fb6593a91a98e SHA256 73bac12a01d5ccb6835421c065dd0da3cd8bd9f2f2821c5647dff00cd44590ce -MD5 a38369f66fe58924eb0128e055133a0b ChangeLog 12277 -RMD160 6987f3c3e55d02c6513cc124b6855c53f66bf4ea ChangeLog 12277 -SHA256 73bac12a01d5ccb6835421c065dd0da3cd8bd9f2f2821c5647dff00cd44590ce ChangeLog 12277 +MISC ChangeLog 12403 RMD160 4e0424e023376fc246d0ec44ed4ee3771ece2690 SHA1 10431cd03a195ea379e20fa3fa5e7d171a3bfd73 SHA256 6c2105bea8c2d143519c22aa8e615afc9e804793a1058bebc512f527cf4e4ecb +MD5 d874ea4a001242c72e415b2a8cdaa86b ChangeLog 12403 +RMD160 4e0424e023376fc246d0ec44ed4ee3771ece2690 ChangeLog 12403 +SHA256 6c2105bea8c2d143519c22aa8e615afc9e804793a1058bebc512f527cf4e4ecb ChangeLog 12403 MISC metadata.xml 177 RMD160 c4ff678488aa3bd8f3e5e4cf6e52a56caba3dad9 SHA1 73b04fb757f8a6473a2c43b0807a95381da37afc SHA256 dfb196addaf8aa212436c53c3d47cda0d10c2850c59fa2dcb7554dfa10190af2 MD5 b263ff7675308d90b75a170acae3f5ff metadata.xml 177 RMD160 c4ff678488aa3bd8f3e5e4cf6e52a56caba3dad9 metadata.xml 177 @@ -64,10 +72,13 @@ SHA256 16ece8103a44cee10de1d41a141f1977347b58400ae28d017bd88f6f7e529c86 files/di MD5 8f0274cece4407ca84077c1baa884261 files/digest-esound-0.2.37 244 RMD160 d11b14e690758ea5f84308c82185fac37f1a4924 files/digest-esound-0.2.37 244 SHA256 72b8cd9f0d4ee6501c2c4671c0e6745af03cc90be5751823dca63fc5af3b15d1 files/digest-esound-0.2.37 244 +MD5 8f0274cece4407ca84077c1baa884261 files/digest-esound-0.2.37-r1 244 +RMD160 d11b14e690758ea5f84308c82185fac37f1a4924 files/digest-esound-0.2.37-r1 244 +SHA256 72b8cd9f0d4ee6501c2c4671c0e6745af03cc90be5751823dca63fc5af3b15d1 files/digest-esound-0.2.37-r1 244 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.3 (GNU/Linux) -iD8DBQFF/twkomPajV0RnrERAppYAJ9ZCE8XHN8frRX353jxJe2ge5tiyACfRIqM -W8cbt80ylPlsl4Po++d+CEQ= -=yyDb +iD8DBQFGAuVgomPajV0RnrERAgZiAJ46UzG/Lcd3osDU7OjHQ/bZWKPe7ACff6tE +7wvzQaJGWbncpI2OdcZ6P7o= +=PXlP -----END PGP SIGNATURE----- diff --git a/media-sound/esound/esound-0.2.37-r1.ebuild b/media-sound/esound/esound-0.2.37-r1.ebuild new file mode 100644 index 000000000000..7df5bd3b9018 --- /dev/null +++ b/media-sound/esound/esound-0.2.37-r1.ebuild @@ -0,0 +1,86 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/media-sound/esound/esound-0.2.37-r1.ebuild,v 1.1 2007/03/22 20:22:19 dang Exp $ + +WANT_AUTOMAKE=1.10 +inherit libtool gnome.org eutils autotools flag-o-matic + +DESCRIPTION="The Enlightened Sound Daemon" +HOMEPAGE="http://www.tux.org/~ricdude/EsounD.html" + +LICENSE="LGPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc-macos ~ppc64 ~sh ~sparc ~x86 ~x86-fbsd" +IUSE="alsa debug ipv6 tcpd" + +# esound comes with arts support, but it hasn't been tested yet, feel free to +# submit patches/improvements +DEPEND=">=media-libs/audiofile-0.1.5 + alsa? ( >=media-libs/alsa-lib-0.5.10b ) + tcpd? ( >=sys-apps/tcp-wrappers-7.6-r2 )" +# arts? ( kde-base/arts ) + +RDEPEND="${DEPEND} + app-admin/eselect-esd" + +src_unpack() { + + unpack ${A} + cd "${S}" + + epatch "${FILESDIR}/${PN}-0.2.32-amd64.patch" + # please note, this is a conditional, version specific patch!!! + # when bumping avoid bugs like #103969 + use ppc-macos && epatch "${FILESDIR}/${PN}-0.2.36-ppc-macos.patch" + + epatch "${FILESDIR}/${PN}-0.2.36-mode_t.patch" + epatch "${FILESDIR}/${PN}-0.2.36-asneeded.patch" + # Fix compile with debug; bug #170971 + epatch "${FILESDIR}/${PN}-0.2.37-debug.patch" + + # Fix 100% cpu usage. Bug #171300 + # Note: depends on debug patch above + epatch "${FILESDIR}"/${P}-cpu-drain.patch + + + AT_M4DIR="m4" eautomake + + elibtoolize +} + +src_compile() { + # Strict aliasing problem + append-flags -fno-strict-aliasing + + econf \ + --sysconfdir=/etc/esd \ + $(use_enable ipv6) \ + $(use_enable debug debugging) \ + $(use_enable alsa) \ + $(use_with tcpd libwrap) \ + --disable-dependency-tracking \ + || die "Configure failed" + + emake || die "Make failed" +} + +src_install() { + emake -j1 DESTDIR="${D}" install || die "Installation failed" + mv "${D}/usr/bin/"{esd,esound-esd} + + dodoc AUTHORS ChangeLog MAINTAINERS NEWS README TIPS TODO + + [[ -d "docs/html" ]] && dohtml -r docs/html/* + + newconfd "${FILESDIR}/esound.conf.d" esound + + extradepend="" + use tcpd && extradepend=" portmap" + use alsa && extradepend="$extradepend alsasound" + sed -e "s/@extradepend@/$extradepend/" "${FILESDIR}/esound.init.d.2" >"${T}/esound" + doinitd "${T}/esound" +} + +pkg_postinst() { + eselect esd update --if-unset +} diff --git a/media-sound/esound/files/digest-esound-0.2.37-r1 b/media-sound/esound/files/digest-esound-0.2.37-r1 new file mode 100644 index 000000000000..d3bcabe648f0 --- /dev/null +++ b/media-sound/esound/files/digest-esound-0.2.37-r1 @@ -0,0 +1,3 @@ +MD5 99cc68770176c8940cf346f60208420e esound-0.2.37.tar.bz2 383831 +RMD160 36f6630df4fa3c611d9b7ff40157504334535abe esound-0.2.37.tar.bz2 383831 +SHA256 3c8525c08cce45557832cb20cc74e7b3d6c9664410f117372391b59fda2d4147 esound-0.2.37.tar.bz2 383831 diff --git a/media-sound/esound/files/esound-0.2.37-cpu-drain.patch b/media-sound/esound/files/esound-0.2.37-cpu-drain.patch new file mode 100644 index 000000000000..e731bbc66915 --- /dev/null +++ b/media-sound/esound/files/esound-0.2.37-cpu-drain.patch @@ -0,0 +1,21 @@ +diff --exclude-from=/home/dang/bin/scripts/diffrc -up -ruN esound-0.2.37.orig/players.c esound-0.2.37/players.c +--- esound-0.2.37.orig/players.c 2007-03-22 13:58:49.000000000 -0400 ++++ esound-0.2.37/players.c 2007-03-22 13:59:49.000000000 -0400 +@@ -309,13 +309,15 @@ int read_player( esd_player_t *player ) + player->data_buffer + player->actual_length, + player->buffer_length - player->actual_length, + actual, "str rd" ); +- if (actual < player->buffer_length - player->actual_length) +- break; + + /* check for end of stream */ + if ( actual == 0 + || ( actual < 0 && errno != EAGAIN && errno != EINTR ) ) + return -1; ++ ++ if (actual < player->buffer_length - player->actual_length) ++ break; ++ + /* more data, save how much we got */ + if ( actual > 0 ) + player->actual_length += actual; -- 2.26.2