Gentoo Archives: gentoo-commits

From: Mike Gilbert <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-p2p/transmission/, net-p2p/transmission/files/
Date: Sat, 03 Oct 2015 19:09:39
Message-Id: 1443899371.63a4598a1ae65384bf49a869b292a90509d96633.floppym@gentoo
1 commit: 63a4598a1ae65384bf49a869b292a90509d96633
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Sat Oct 3 19:09:17 2015 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Sat Oct 3 19:09:31 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=63a4598a
7
8 net-p2p/transmission: Fix segfault
9
10 Bug: https://bugs.gentoo.org/534308
11
12 Package-Manager: portage-2.2.22_p5
13
14 .../files/2.84-node_alloc-segfault.patch | 55 ++++++++++++++++++++++
15 ...-2.84-r2.ebuild => transmission-2.84-r3.ebuild} | 1 +
16 2 files changed, 56 insertions(+)
17
18 diff --git a/net-p2p/transmission/files/2.84-node_alloc-segfault.patch b/net-p2p/transmission/files/2.84-node_alloc-segfault.patch
19 new file mode 100644
20 index 0000000..7172428
21 --- /dev/null
22 +++ b/net-p2p/transmission/files/2.84-node_alloc-segfault.patch
23 @@ -0,0 +1,55 @@
24 +Index: libtransmission/list.c
25 +===================================================================
26 +--- libtransmission/list.c (revision 14318)
27 ++++ libtransmission/list.c (revision 14319)
28 +@@ -30,20 +30,24 @@
29 + static tr_list*
30 + node_alloc (void)
31 + {
32 +- tr_list * ret;
33 ++ tr_list * ret = NULL;
34 ++ tr_lock * lock = getRecycledNodesLock ();
35 +
36 +- if (recycled_nodes == NULL)
37 ++ tr_lockLock (lock);
38 ++
39 ++ if (recycled_nodes != NULL)
40 + {
41 +- ret = tr_new (tr_list, 1);
42 +- }
43 +- else
44 +- {
45 +- tr_lockLock (getRecycledNodesLock ());
46 + ret = recycled_nodes;
47 + recycled_nodes = recycled_nodes->next;
48 +- tr_lockUnlock (getRecycledNodesLock ());
49 + }
50 +
51 ++ tr_lockUnlock (lock);
52 ++
53 ++ if (ret == NULL)
54 ++ {
55 ++ ret = tr_new (tr_list, 1);
56 ++ }
57 ++
58 + *ret = TR_LIST_CLEAR;
59 + return ret;
60 + }
61 +@@ -51,13 +55,15 @@
62 + static void
63 + node_free (tr_list* node)
64 + {
65 ++ tr_lock * lock = getRecycledNodesLock ();
66 ++
67 + if (node != NULL)
68 + {
69 + *node = TR_LIST_CLEAR;
70 +- tr_lockLock (getRecycledNodesLock ());
71 ++ tr_lockLock (lock);
72 + node->next = recycled_nodes;
73 + recycled_nodes = node;
74 +- tr_lockUnlock (getRecycledNodesLock ());
75 ++ tr_lockUnlock (lock);
76 + }
77 + }
78 +
79
80 diff --git a/net-p2p/transmission/transmission-2.84-r2.ebuild b/net-p2p/transmission/transmission-2.84-r3.ebuild
81 similarity index 98%
82 rename from net-p2p/transmission/transmission-2.84-r2.ebuild
83 rename to net-p2p/transmission/transmission-2.84-r3.ebuild
84 index 09d42ad..d605c80 100644
85 --- a/net-p2p/transmission/transmission-2.84-r2.ebuild
86 +++ b/net-p2p/transmission/transmission-2.84-r3.ebuild
87 @@ -75,6 +75,7 @@ src_prepare() {
88
89 epatch "${FILESDIR}/2.84-miniupnp14.patch"
90 epatch "${FILESDIR}/2.84-libevent-2.1.5.patch"
91 + epatch "${FILESDIR}/2.84-node_alloc-segfault.patch"
92
93 epatch_user
94 eautoreconf