[ ijbswa-Bugs-3525694 ] Disabling Privoxy via right-click on tasktray icon hangs Pri
SourceForge.net <[email protected]>
| Newsgroups | gmane.comp.web.privoxy.devel |
|---|---|
| Message-ID | <[email protected]> |
Bugs item #3525694, was opened at 2012-05-10 18:49
Message generated for change (Comment added) made by ler762
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=111118&aid=3525694&group_id=11118
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: windows-specific
Group: None
Status: Pending
Resolution: None
Priority: 5
Private: No
Submitted By: Tim H (thubb)
Assigned to: Nobody/Anonymous (nobody)
Summary: Disabling Privoxy via right-click on tasktray icon hangs Pri
Initial Comment:
Privoxy very occasionally fatally hangs when it is disabled via right-clicking on the tasktray icon and unchecking "Enable".
CPU time drops to zero and there is no further response to right-clicks. Any communication in progress is interrupted. The only resolution is to kill the process.
I've had this happen twice since I upgraded to 3.0.19 on 2012-04-03. I disable/enable Privoxy frequently as my filters intentionally strip features of some sites that I occasionally need to re-enable. There is no information in the Privoxy log or system event log. I use both Chrome and Seamonkey as browsers and both were in use at the time of the failure. I also had several tabs open in each browser so I don't know which site was actually being accessed at the time. Killing the process appears to keep the final log entries from being flushed to the disk since the last entry in the Privoxy log is from over 10 minutes prior to the hang.
Sorry I can't give any more information. Is there something you'd like me to do if it happens again? Would you like me to upload my config & user files?
Privoxy version 3.0.19
Windows XP Pro SP3
External router and switch in use
Avast anti-virus
----------------------------------------------------------------------
>Comment By: Lee (ler762)
Date: 2012-05-26 12:55
Message:
> If you could test whether or not my patch obviously makes things worse
It seems like the icon stays the blue background/white P a bit more than
without the patch, but not much & it might be a perception thing since I'm
looking.for differences. But either ay - no problems.
After adding your
for (i = 0; i < 1000; i++)
patch I was able to get privoxy to hang. See attached privoxy_hang.log
Lee
----------------------------------------------------------------------
Comment By: Fabian Keil (fabiankeil)
Date: 2012-05-26 05:57
Message:
I have no strong opinions about whether or not toggling gets logged, as
long as the behavior is consistent.
I don't think duplicating the log message is the answer, though. I believe
the global_toggle_state modification should be factored out into a separate
function, that also takes care of the logging (or not) and the tray icon
fiddling.
Currently we mess with global_toggle_state in three separate files, but
only in w32log.c the tray icon is explicitly set.
In the other cases we seem to rely on the tray icon being set to the idle
icon after the next tray icon animation is finished. Given that the tray
icon animation can be deactivated, that doesn't seem like a sound strategy
to me.
A patch would be welcome, of course.
If you could test whether or not my patch obviously makes things worse, I'd
appreciate it even if the problem doesn't manifest on your system.
I'd also be interested to know if the following patch causes hangs when
multiple threads are active at the same time. If SetIdleIcon() isn't
thread-safe, calling it more often should increase the chances of
triggering the problem:
diff --git a/w32log.c b/w32log.c
index 4211a87..188fe6b 100644
--- a/w32log.c
+++ b/w32log.c
@@ -550,6 +550,14 @@ int LogPutStringNoMatch(const char *pszText, int
style)
*********************************************************************/
void LogShowActivity(void)
{
+ int i;
+
+ /* Try to figure out if SetIdleIcon() is thread-safe */
+ for (i = 0; i < 1000; i++)
+ {
+ SetIdleIcon();
+ }
+
/* Start some activity timers */
if (g_bShowActivityAnimation)
{
----------------------------------------------------------------------
Comment By: Lee (ler762)
Date: 2012-05-25 07:38
Message:
Seems to me that the purpose of a log file is to allow one to reconstruct
what happened - so I added code to log when toggled via the web page. It's
not what I'd call "production ready" since it also emits a log msg when the
toggle sttus page is opened..
2012-05-24 22:36:20.665 000009c0 Crunch: CGI Call: http://p.p/
2012-05-24 22:36:20.727 0000049c Crunch: CGI Call:
http://config.privoxy.org/send-stylesheet
2012-05-24 22:36:25.126 00000f74 Info: Now toggled ON.
2012-05-24 22:36:25.126 00000f74 Crunch: CGI Call:
http://config.privoxy.org/toggle
2012-05-24 22:36:25.158 00000134 Crunch: CGI Call:
http://config.privoxy.org/send-stylesheet
2012-05-24 22:36:27.903 00000e78 Info: Now toggled OFF.
2012-05-24 22:36:27.919 00000e78 Crunch: CGI Call:
http://config.privoxy.org/toggle?set=disable
2012-05-24 22:36:27.966 00000d20 Crunch: CGI Call:
http://config.privoxy.org/send-stylesheet
want me to try to fix that & submit a patch?
I can't duplicate the problem of privoxy freezing. So while I can test the
patch to see if Anyting Bad Happens, I'm not going to be able to tell if it
fixes the hang issue.
Lee
----------------------------------------------------------------------
Comment By: Fabian Keil (fabiankeil)
Date: 2012-05-25 06:20
Message:
The other link doesn't work with my browser configuration either.
The HTTP toggle isn't supposed to emit the log message, so the behavior is
expected. This inconsistency should probably be fixed one way or the other,
but given that the message from the tray toggle gets logged, it's probably
unrelated to the hangs.
I'll attach a patch that might help. Can anyone test it?
----------------------------------------------------------------------
Comment By: Lee (ler762)
Date: 2012-05-24 20:27
Message:
Have you tried not having the wget background process running every 3
minutes?
I can't duplicate your problem on Vista .. tried toggling it off & on
manually more than 20 times and no problem. Ran this script using cygwin
-------- begin ----------
#!/bin/sh
while [ "1" == "1" ]; do
curl -q --proxy 127.0.0.1:8118 --referer http://config.privoxy.org/toggle
--silent \
http://config.privoxy.org/toggle?set=disable > /dev/null
curl -q --proxy 127.0.0.1:8118 --referer http://config.privoxy.org/toggle
--silent \
http://config.privoxy.org/toggle?set=enable > /dev/null
done
------ end --------
while browsing yahoo.com - still no problem.
Here's the config I used for testing:
The following options were given in the config file:
user-manual ./doc/user-manual/
forward / .
forward 10.*.*.*/ .
forward 127.*.*.*/ .
forward 192.168.*.*/ .
confdir .
logdir c:\temp
actionsfile match-all.action
actionsfile default.action
actionsfile user.action
actionsfile blocksites.action
actionsfile malwareSites.action
actionsfile spw.action
actionsfile winhelp.action
actionsfile unblock.action
filterfile default.filter
filterfile user.filter
logfile privoxy.log
debug 1
debug 1024
debug 4096
debug 8192
listen-address 127.0.0.1:8118
toggle 1
enable-remote-toggle 1
enable-remote-http-toggle 0
enable-edit-actions 1
enforce-blocks 0
buffer-limit 4096
forwarded-connect-retries 0
accept-intercepted-requests 0
allow-cgi-request-crunching 0
split-large-forms 0
keep-alive-timeout 600
default-server-timeout 300
connection-sharing 0
socket-timeout 300
max-client-connections 256
handle-as-empty-doc-returns-ok 1
log-max-lines 1000
log-font-name Courier New
log-font-size 9
Regards,
Lee
----------------------------------------------------------------------
Comment By: Tim H (thubb)
Date: 2012-05-23 00:16
Message:
'...can still reproduce the problem after setting "activity-animation 0".'
Yes, I can still reproduce it by right-clicking the tray icon and toggling
the enable state. It typically takes less than 20 right-clicks for it to
happen on my system. Note that a right-click forces the icon to update even
with activity animation off. Also note that the HTTP toggle request does
not get an "Info: Now toggled xxx." log entry while the right-click toggle
does (if that helps).
I've sent a new link to the files by email. This link is only valid until
2012-06-05.
----------------------------------------------------------------------
Comment By: Fabian Keil (fabiankeil)
Date: 2012-05-18 08:30
Message:
https://skydrive.live.com/ doesn't work with my browser configuration so I
wasn't able to access the config files or the script used to reproduce the
problem.
Anyway, it would be useful to know if you can still reproduce the problem
after setting "activity-animation 0".
If you can't, this could indicate a race condition that should be fixable
without requiring a deeper understanding of the win32 API.
----------------------------------------------------------------------
Comment By: Fabian Keil (fabiankeil)
Date: 2012-05-11 11:26
Message:
Thanks for the report.
If you have logging enabled, toggling Privoxy off through the taskbar is
supposed to result in a "Now toggled OFF" log message.
Do you never get those, or just not when Privoxy is hanging?
It seems unlikely to me that log messages from 10 minutes ago would be lost
on exit. A more likely explanation would be that there simply are no log
messages (either because there was no log-worthy event, or because the
problem affects logging as well).
Is the GUI log not generally in sync with the logfile on disk?
Can you reproduce the problem by running wget in a loop to toggle Privoxy
on and off through the remote toggle?
http://config.privoxy.org/user-manual/config.html#ENABLE-REMOTE-TOGGLE
This would rule out a bug in Privoxy's Windows-specific code.
While I expect this to be a bug in the Windows-specific code, it would
still be good to rule out a platform-independent bug which would be a lot
easier to debug.
----------------------------------------------------------------------
Comment By: Tim H (thubb)
Date: 2012-05-10 19:00
Message:
I also have a background process that runs every 3 minutes (to issue an
audio warning if Privoxy is disabled) and executes these commands (and
more) in a Cygwin Bash script:
http_proxy=http://127.0.0.1:8118
wget --proxy -q -O - http://config.privoxy.org/ | ...
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=111118&aid=3525694&group_id=11118
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/