diff options
author | 2010-01-25 18:36:50 +0000 | |
---|---|---|
committer | 2010-01-25 18:36:50 +0000 | |
commit | 0c1f5b459e81fa5ac1d9ec7b856f957b50b25cd3 (patch) | |
tree | 0844429bd41f4fb214f269e5bc06e235f097e3fd /sys-process/unixtop | |
parent | Initial import of bacon, needed for shotgun testing. (diff) | |
download | gentoo-2-0c1f5b459e81fa5ac1d9ec7b856f957b50b25cd3.tar.gz gentoo-2-0c1f5b459e81fa5ac1d9ec7b856f957b50b25cd3.tar.bz2 gentoo-2-0c1f5b459e81fa5ac1d9ec7b856f957b50b25cd3.zip |
Add patch for top crashing when high thread-id's are involved, thanks calculuspenguin for the pointer in bug #302142
(Portage version: 2.2.00.15200-prefix/cvs/Darwin powerpc)
Diffstat (limited to 'sys-process/unixtop')
-rw-r--r-- | sys-process/unixtop/ChangeLog | 10 | ||||
-rw-r--r-- | sys-process/unixtop/files/unixtop-3.8_beta1-high-threadid-crash.patch | 75 | ||||
-rw-r--r-- | sys-process/unixtop/unixtop-3.8_beta1-r2.ebuild | 48 |
3 files changed, 132 insertions, 1 deletions
diff --git a/sys-process/unixtop/ChangeLog b/sys-process/unixtop/ChangeLog index 0afb2cd53512..63d2d83881df 100644 --- a/sys-process/unixtop/ChangeLog +++ b/sys-process/unixtop/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for sys-process/unixtop # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-process/unixtop/ChangeLog,v 1.2 2010/01/15 19:55:39 ulm Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-process/unixtop/ChangeLog,v 1.3 2010/01/25 18:36:49 grobian Exp $ + +*unixtop-3.8_beta1-r2 (25 Jan 2010) + + 25 Jan 2010; Fabian Groffen <grobian@gentoo.org> + +unixtop-3.8_beta1-r2.ebuild, + +files/unixtop-3.8_beta1-high-threadid-crash.patch: + Add patch for top crashing when high thread-id's are involved, thanks + calculuspenguin for the pointer in bug #302142 15 Jan 2010; Ulrich Mueller <ulm@gentoo.org> unixtop-3.8_beta1-r1.ebuild: LICENSE is identical with BSD, bug 301123. diff --git a/sys-process/unixtop/files/unixtop-3.8_beta1-high-threadid-crash.patch b/sys-process/unixtop/files/unixtop-3.8_beta1-high-threadid-crash.patch new file mode 100644 index 000000000000..a5a3bc58546d --- /dev/null +++ b/sys-process/unixtop/files/unixtop-3.8_beta1-high-threadid-crash.patch @@ -0,0 +1,75 @@ +http://sourceforge.net/tracker/index.php?func=detail&aid=2815842&group_id=72892&atid=536042 + +*** hash.c-old Thu Jul 2 15:30:55 2009 +--- hash.c Thu Jul 2 15:48:39 2009 +*************** +*** 1354,1360 **** + hi->value = value; + + /* hash to the bucket */ +! bucket = &(ht->buckets[((key.k_thr * 10000 + key.k_pid) % ht->num_buckets)]); + + /* walk the list to make sure we do not have a duplicate */ + ll = &(bucket->list); +--- 1354,1360 ---- + hi->value = value; + + /* hash to the bucket */ +! bucket = &(ht->buckets[(((unsigned long)(key.k_thr) * 10000U + (unsigned long)(key.k_pid)) % ht->num_buckets)]); + + /* walk the list to make sure we do not have a duplicate */ + ll = &(bucket->list); +*************** +*** 1408,1414 **** + pidthr_t k1; + + /* find the bucket */ +! bucket = &(ht->buckets[((key.k_thr * 10000 + key.k_pid) % ht->num_buckets)]); + + /* walk the list until we find the existing item */ + ll = &(bucket->list); +--- 1408,1414 ---- + pidthr_t k1; + + /* find the bucket */ +! bucket = &(ht->buckets[(((unsigned long)(key.k_thr) * 10000U + (unsigned long)(key.k_pid)) % ht->num_buckets)]); + + /* walk the list until we find the existing item */ + ll = &(bucket->list); +*************** +*** 1460,1466 **** + pidthr_t k1; + + result = NULL; +! if ((bucket = &(ht->buckets[((key.k_thr * 10000 + key.k_pid) % ht->num_buckets)])) != NULL) + { + ll = &(bucket->list); + li = LL_FIRST(ll); +--- 1460,1466 ---- + pidthr_t k1; + + result = NULL; +! if ((bucket = &(ht->buckets[(((unsigned long)(key.k_thr) * 10000U + (unsigned long)(key.k_pid)) % ht->num_buckets)])) != NULL) + { + ll = &(bucket->list); + li = LL_FIRST(ll); +*************** +*** 1499,1505 **** + pidthr_t k1; + + result = NULL; +! if ((bucket = &(ht->buckets[((key.k_thr * 10000 + key.k_pid) % ht->num_buckets)])) != NULL) + { + ll = &(bucket->list); + li = LL_FIRST(ll); +--- 1499,1505 ---- + pidthr_t k1; + + result = NULL; +! if ((bucket = &(ht->buckets[(((unsigned long)(key.k_thr) * 10000U + (unsigned long)(key.k_pid)) % ht->num_buckets)])) != NULL) + { + ll = &(bucket->list); + li = LL_FIRST(ll); + + + diff --git a/sys-process/unixtop/unixtop-3.8_beta1-r2.ebuild b/sys-process/unixtop/unixtop-3.8_beta1-r2.ebuild new file mode 100644 index 000000000000..4f5541a1580d --- /dev/null +++ b/sys-process/unixtop/unixtop-3.8_beta1-r2.ebuild @@ -0,0 +1,48 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-process/unixtop/unixtop-3.8_beta1-r2.ebuild,v 1.1 2010/01/25 18:36:49 grobian Exp $ + +inherit eutils autotools + +DESCRIPTION="top for UNIX systems" +HOMEPAGE="http://unixtop.sourceforge.net/" +SRC_URI="mirror://sourceforge/unixtop/top-${PV/_/}.tar.bz2" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" +IUSE="" + +RDEPEND="sys-libs/ncurses" +DEPEND="${RDEPEND}" + +S=${WORKDIR}/top-${PV/_/} + +src_unpack() { + unpack ${A} + cd "${S}" + epatch "${FILESDIR}"/${P}-ncurses.patch + epatch "${FILESDIR}"/${P}-no-AX-macros.patch + epatch "${FILESDIR}"/${P}-renice-segfault.patch + epatch "${FILESDIR}"/${P}-memleak-fix.patch + epatch "${FILESDIR}"/${P}-high-threadid-crash.patch + eautoreconf +} + +src_compile() { + local myconf= + + # don't do bi-arch cruft on hosts that support that, such as Solaris + export enable_dualarch=no + + # configure demands an override because on OSX this is "experimental" + [[ ${CHOST} == *-darwin* ]] && myconf="${myconf} --with-module=macosx" + + econf ${myconf} || die + emake || die +} + +src_install() { + emake DESTDIR="${D}" install + dodoc README FAQ Y2K +} |