diff options
author | Fabian Groffen <grobian@gentoo.org> | 2010-01-25 18:36:50 +0000 |
---|---|---|
committer | Fabian Groffen <grobian@gentoo.org> | 2010-01-25 18:36:50 +0000 |
commit | 0c1f5b459e81fa5ac1d9ec7b856f957b50b25cd3 (patch) | |
tree | 0844429bd41f4fb214f269e5bc06e235f097e3fd /sys-process/unixtop/files | |
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/files')
-rw-r--r-- | sys-process/unixtop/files/unixtop-3.8_beta1-high-threadid-crash.patch | 75 |
1 files changed, 75 insertions, 0 deletions
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); + + + |