/[gentoo-x86]/net-misc/stargazer/files/patches/stg-2.408-fix-crash-on-stop.patch
Gentoo

Contents of /net-misc/stargazer/files/patches/stg-2.408-fix-crash-on-stop.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download) (as text)
Sat Feb 23 20:13:30 2013 UTC (6 years, 11 months ago) by tomwij
Branch: MAIN
CVS Tags: HEAD
File MIME type: text/x-diff
New ebuild for stargazer. Contributed by SpiderX. Fixes bug #452916.

(Portage version: 2.1.11.52/cvs/Linux x86_64, signed Manifest commit with key 6D34E57D)

1 diff -Naur stg-2.408/projects/rscriptd/listener.cpp stg-2.408-patched/projects/rscriptd/listener.cpp
2 --- stg-2.408/projects/rscriptd/listener.cpp 2012-02-09 12:26:59.000000000 +0200
3 +++ stg-2.408-patched/projects/rscriptd/listener.cpp 2013-02-11 09:04:32.000000000 +0200
4 @@ -49,6 +49,8 @@
5 receiverStopped(true),
6 processorStopped(true),
7 userTimeout(0),
8 + receiverThread(0),
9 + processorThread(0),
10 listenSocket(0)
11 {
12 version = "rscriptd listener v.1.2";
13 @@ -149,8 +151,10 @@
14 }
15 }
16
17 -pthread_join(receiverThread, NULL);
18 -pthread_join(processorThread, NULL);
19 +if (receiverThread != 0)
20 + pthread_join(receiverThread, NULL);
21 +if (processorThread != 0)
22 + pthread_join(processorThread, NULL);
23
24 pthread_mutex_destroy(&mutex);
25
26 diff -Naur stg-2.408/projects/stargazer/eventloop.cpp stg-2.408-patched/projects/stargazer/eventloop.cpp
27 --- stg-2.408/projects/stargazer/eventloop.cpp 2012-02-09 12:27:06.000000000 +0200
28 +++ stg-2.408-patched/projects/stargazer/eventloop.cpp 2013-02-11 09:03:11.000000000 +0200
29 @@ -10,7 +10,7 @@
30 : ACTIONS_LIST(),
31 _running(false),
32 _stopped(true),
33 - _tid(),
34 + _tid(0),
35 _mutex(),
36 _condition()
37 {
38 @@ -41,7 +41,8 @@
39 // Wake up thread
40 pthread_cond_signal(&_condition);
41 // Wait until thread exit
42 -pthread_join(_tid, NULL);
43 +if (_tid != 0)
44 + pthread_join(_tid, NULL);
45 return false;
46 }
47
48 diff -Naur stg-2.408/projects/stargazer/plugins/capture/cap_nf/cap_nf.cpp stg-2.408-patched/projects/stargazer/plugins/capture/cap_nf/cap_nf.cpp
49 --- stg-2.408/projects/stargazer/plugins/capture/cap_nf/cap_nf.cpp 2012-02-09 12:27:14.000000000 +0200
50 +++ stg-2.408-patched/projects/stargazer/plugins/capture/cap_nf/cap_nf.cpp 2013-02-11 09:01:34.000000000 +0200
51 @@ -55,8 +55,8 @@
52 NF_CAP::NF_CAP()
53 : traffCnt(NULL),
54 settings(),
55 - tidTCP(),
56 - tidUDP(),
57 + tidTCP(0),
58 + tidUDP(0),
59 runningTCP(false),
60 runningUDP(false),
61 stoppedTCP(true),
62 @@ -153,7 +153,8 @@
63 }
64 if (stoppedUDP)
65 {
66 - pthread_join(tidUDP, NULL);
67 + if (tidUDP != 0)
68 + pthread_join(tidUDP, NULL);
69 }
70 else
71 {
72 @@ -176,7 +177,8 @@
73 }
74 if (stoppedTCP)
75 {
76 - pthread_join(tidTCP, NULL);
77 + if (tidTCP != 0)
78 + pthread_join(tidTCP, NULL);
79 }
80 else
81 {
82 diff -Naur stg-2.408/projects/stargazer/plugins/capture/ether_linux/ether_cap.cpp stg-2.408-patched/projects/stargazer/plugins/capture/ether_linux/ether_cap.cpp
83 --- stg-2.408/projects/stargazer/plugins/capture/ether_linux/ether_cap.cpp 2012-02-09 12:27:15.000000000 +0200
84 +++ stg-2.408-patched/projects/stargazer/plugins/capture/ether_linux/ether_cap.cpp 2013-02-11 09:02:05.000000000 +0200
85 @@ -74,7 +74,7 @@
86 //-----------------------------------------------------------------------------
87 ETHER_CAP::ETHER_CAP()
88 : errorStr(),
89 - thread(),
90 + thread(0),
91 nonstop(false),
92 isRunning(false),
93 capSock(-1),
94 @@ -140,7 +140,8 @@
95 }
96 else
97 {
98 - pthread_join(thread, NULL);
99 + if (thread != 0)
100 + pthread_join(thread, NULL);
101 }
102 }
103
104 diff -Naur stg-2.408/projects/stargazer/plugins/capture/ipq_linux/ipq_cap.cpp stg-2.408-patched/projects/stargazer/plugins/capture/ipq_linux/ipq_cap.cpp
105 --- stg-2.408/projects/stargazer/plugins/capture/ipq_linux/ipq_cap.cpp 2012-02-09 12:27:15.000000000 +0200
106 +++ stg-2.408-patched/projects/stargazer/plugins/capture/ipq_linux/ipq_cap.cpp 2013-02-11 09:02:37.000000000 +0200
107 @@ -58,7 +58,7 @@
108 IPQ_CAP::IPQ_CAP()
109 : ipq_h(NULL),
110 errorStr(),
111 - thread(),
112 + thread(0),
113 nonstop(false),
114 isRunning(false),
115 capSock(-1),
116 @@ -120,7 +120,8 @@
117 }
118 else
119 {
120 - pthread_join(thread, NULL);
121 + if (thread != 0)
122 + pthread_join(thread, NULL);
123 }
124 }
125 IPQCapClose();
126 diff -Naur stg-2.408/projects/stargazer/plugins/configuration/rpcconfig/rpcconfig.cpp stg-2.408-patched/projects/stargazer/plugins/configuration/rpcconfig/rpcconfig.cpp
127 --- stg-2.408/projects/stargazer/plugins/configuration/rpcconfig/rpcconfig.cpp 2012-02-09 12:27:16.000000000 +0200
128 +++ stg-2.408-patched/projects/stargazer/plugins/configuration/rpcconfig/rpcconfig.cpp 2013-02-11 09:00:33.000000000 +0200
129 @@ -93,7 +93,7 @@
130 rpcServer(NULL),
131 running(false),
132 stopped(true),
133 - tid(),
134 + tid(0),
135 cookies(),
136 dayFee(0),
137 dirNames()
138 @@ -201,7 +201,8 @@
139 }
140 else
141 {
142 - pthread_join(tid, NULL);
143 + if (tid != 0)
144 + pthread_join(tid, NULL);
145 }
146
147 close(fd);
148 diff -Naur stg-2.408/projects/stargazer/plugins/other/smux/smux.cpp stg-2.408-patched/projects/stargazer/plugins/other/smux/smux.cpp
149 --- stg-2.408/projects/stargazer/plugins/other/smux/smux.cpp 2012-02-09 12:27:24.000000000 +0200
150 +++ stg-2.408-patched/projects/stargazer/plugins/other/smux/smux.cpp 2013-02-11 09:07:54.000000000 +0200
151 @@ -99,7 +99,7 @@
152 errorStr(),
153 smuxSettings(),
154 settings(),
155 - thread(),
156 + thread(0),
157 mutex(),
158 running(false),
159 stopped(true),
160 @@ -227,7 +227,7 @@
161 }
162 }
163
164 -if (stopped)
165 +if (stopped && thread != 0)
166 pthread_join(thread, NULL);
167
168 ResetNotifiers();
169 diff -Naur stg-2.408/projects/stargazer/stg_timer.cpp stg-2.408-patched/projects/stargazer/stg_timer.cpp
170 --- stg-2.408/projects/stargazer/stg_timer.cpp 2012-02-09 12:27:30.000000000 +0200
171 +++ stg-2.408-patched/projects/stargazer/stg_timer.cpp 2013-02-11 08:58:55.000000000 +0200
172 @@ -7,7 +7,7 @@
173 #include "stg/common.h"
174
175 static int nonstop;
176 -static pthread_t thrStgTimer;
177 +static pthread_t thrStgTimer(0);
178 static bool isTimerRunning = false;
179 volatile time_t stgTime;
180
181 @@ -101,7 +101,8 @@
182 void StopStgTimer()
183 {
184 nonstop = 0;
185 -pthread_join(thrStgTimer, NULL); // Cleanup thread resources
186 +if (thrStgTimer != 0)
187 + pthread_join(thrStgTimer, NULL); // Cleanup thread resources
188 printfd(__FILE__, "STG_TIMER stopped\n");
189 }
190 //-----------------------------------------------------------------------------

  ViewVC Help
Powered by ViewVC 1.1.20