Gentoo Archives: gentoo-commits

From: "Fabian Groffen (grobian)" <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-process/unixtop/files: unixtop-3.8_beta1-high-threadid-crash.patch
Date: Mon, 25 Jan 2010 18:36:58
Message-Id: E1NZTnv-0006ND-KT@stork.gentoo.org
1 grobian 10/01/25 18:36:51
2
3 Added: unixtop-3.8_beta1-high-threadid-crash.patch
4 Log:
5 Add patch for top crashing when high thread-id's are involved, thanks calculuspenguin for the pointer in bug #302142
6 (Portage version: 2.2.00.15200-prefix/cvs/Darwin powerpc)
7
8 Revision Changes Path
9 1.1 sys-process/unixtop/files/unixtop-3.8_beta1-high-threadid-crash.patch
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-process/unixtop/files/unixtop-3.8_beta1-high-threadid-crash.patch?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-process/unixtop/files/unixtop-3.8_beta1-high-threadid-crash.patch?rev=1.1&content-type=text/plain
13
14 Index: unixtop-3.8_beta1-high-threadid-crash.patch
15 ===================================================================
16 http://sourceforge.net/tracker/index.php?func=detail&aid=2815842&group_id=72892&atid=536042
17
18 *** hash.c-old Thu Jul 2 15:30:55 2009
19 --- hash.c Thu Jul 2 15:48:39 2009
20 ***************
21 *** 1354,1360 ****
22 hi->value = value;
23
24 /* hash to the bucket */
25 ! bucket = &(ht->buckets[((key.k_thr * 10000 + key.k_pid) % ht->num_buckets)]);
26
27 /* walk the list to make sure we do not have a duplicate */
28 ll = &(bucket->list);
29 --- 1354,1360 ----
30 hi->value = value;
31
32 /* hash to the bucket */
33 ! bucket = &(ht->buckets[(((unsigned long)(key.k_thr) * 10000U + (unsigned long)(key.k_pid)) % ht->num_buckets)]);
34
35 /* walk the list to make sure we do not have a duplicate */
36 ll = &(bucket->list);
37 ***************
38 *** 1408,1414 ****
39 pidthr_t k1;
40
41 /* find the bucket */
42 ! bucket = &(ht->buckets[((key.k_thr * 10000 + key.k_pid) % ht->num_buckets)]);
43
44 /* walk the list until we find the existing item */
45 ll = &(bucket->list);
46 --- 1408,1414 ----
47 pidthr_t k1;
48
49 /* find the bucket */
50 ! bucket = &(ht->buckets[(((unsigned long)(key.k_thr) * 10000U + (unsigned long)(key.k_pid)) % ht->num_buckets)]);
51
52 /* walk the list until we find the existing item */
53 ll = &(bucket->list);
54 ***************
55 *** 1460,1466 ****
56 pidthr_t k1;
57
58 result = NULL;
59 ! if ((bucket = &(ht->buckets[((key.k_thr * 10000 + key.k_pid) % ht->num_buckets)])) != NULL)
60 {
61 ll = &(bucket->list);
62 li = LL_FIRST(ll);
63 --- 1460,1466 ----
64 pidthr_t k1;
65
66 result = NULL;
67 ! if ((bucket = &(ht->buckets[(((unsigned long)(key.k_thr) * 10000U + (unsigned long)(key.k_pid)) % ht->num_buckets)])) != NULL)
68 {
69 ll = &(bucket->list);
70 li = LL_FIRST(ll);
71 ***************
72 *** 1499,1505 ****
73 pidthr_t k1;
74
75 result = NULL;
76 ! if ((bucket = &(ht->buckets[((key.k_thr * 10000 + key.k_pid) % ht->num_buckets)])) != NULL)
77 {
78 ll = &(bucket->list);
79 li = LL_FIRST(ll);
80 --- 1499,1505 ----
81 pidthr_t k1;
82
83 result = NULL;
84 ! if ((bucket = &(ht->buckets[(((unsigned long)(key.k_thr) * 10000U + (unsigned long)(key.k_pid)) % ht->num_buckets)])) != NULL)
85 {
86 ll = &(bucket->list);
87 li = LL_FIRST(ll);