NoScript causes 100% CPU on FreeBSD Firefox 3.6.8

Ask for help about NoScript, no registration needed to post
MightyD

NoScript causes 100% CPU on FreeBSD Firefox 3.6.8

Post by MightyD »

I'm running Firefox 3.6.8 on FreeBSD 8.0 built out of ports from a brand new profile, where all I've done is install NoScript as an add-on. Once firefox restarts, it begins to consume 100% CPU time.

Looking real quick at the output of ktrace...here's what firefox is doing:

Code: Select all

80110 firefox-bin CALL  gettimeofday(...
 80110 firefox-bin RET   gettimeofday 0
 80110 firefox-bin CALL  gettimeofday(...
 80110 firefox-bin CALL  gettimeofday(...
 80110 firefox-bin RET   gettimeofday 0
 80110 firefox-bin CALL  poll(...,0x2,0x3e7fc18)
 80110 firefox-bin RET   poll 1
I don't know if this helps at all. I have the entire idea isolated here as a testbed. Please let me know if there is anything I can do to help debug this, I'm not afraid of complex ideas. Thanks in advance. :mrgreen:
Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.8) Gecko/20100726 Firefox/3.6.8
guido

Re: NoScript causes 100% CPU on FreeBSD Firefox 3.6.8

Post by guido »

I can confirm that this also happens on Firefiox 3.5.12. The only noscript version that seems not to have this problem is version 1.10. Note that even when I start Firefox with a blank page, with all add-ons disabled except noscript, I get 100% cpu.
Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.12) Gecko/20100908 Firefox/3.5.12
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: NoScript causes 100% CPU on FreeBSD Firefox 3.6.8

Post by Giorgio Maone »

Do you manage to use the UI?
If so, could you try disabling the "WAN IP belongs to LOCAL" option from NoScript Options|Advanced|ABE?
If you can't, please start in safe mode and set the noscript.ABE.wanIpAsLocal about:config preference to false, then restart the browser normally.
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.9) Gecko/20100824 Firefox/3.6.9
guido

Re: NoScript causes 100% CPU on FreeBSD Firefox 3.6.8

Post by guido »

I disabled this option and after I restart Firefox, the CPU is back to normal (read: no longer 100%cpu).
Can you please explain why this "solved" the problem? From my understanding of the meaning of WAN-IP in local, is that it should not result in 100% cpu...

Thanks!
Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.12) Gecko/20100908 Firefox/3.5.12
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: NoScript causes 100% CPU on FreeBSD Firefox 3.6.8

Post by Giorgio Maone »

guido wrote:Can you please explain why this "solved" the problem?
I must confess I've got no idea.
I guessed it could be this because of the version window you gave me (the only major change was this feature) and the trace, which hinted at a timed network activity.
guido wrote: From my understanding of the meaning of WAN-IP in local, is that it should not result in 100% cpu...
It shouldn't, in fact, and it doesn't on the "officially" supported platforms.
It may be a bug in the OS-specific networking code (either at Firefox's or the TCP stack's level), which makes the asynchronous XHR requests sent by NoScript to your router's WAN IP every 5 minutes to cause an infinite poll loop under some circumstances (e.g. if said IP is unreachable or actively refuses connections).
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.9) Gecko/20100824 Firefox/3.6.9
guido

Re: NoScript causes 100% CPU on FreeBSD Firefox 3.6.8

Post by guido »

The Firefox I'm using is on a laptop. When I use it at home I do not have the problem. There I have a NATted network behind a FreeBSD based firewall. At work, I do have the problem. The firewall is almost identical. The only difference is that the IP adres there is part of an announced /28, so not NATting there. Perhaps the problem lies in the fact that the detected WAN IP address equals that of my laptop?
Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.12) Gecko/20100908 Firefox/3.5.12
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: NoScript causes 100% CPU on FreeBSD Firefox 3.6.8

Post by Giorgio Maone »

guido wrote:The Firefox I'm using is on a laptop. When I use it at home I do not have the problem. There I have a NATted network behind a FreeBSD based firewall. At work, I do have the problem. The firewall is almost identical. The only difference is that the IP adres there is part of an announced /28, so not NATting there. Perhaps the problem lies in the fact that the detected WAN IP address equals that of my laptop?
It might be. What does happen if you open http://[your ip here] in Firefox, exactly?
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.9) Gecko/20100824 Firefox/3.6.9
guido

Re: NoScript causes 100% CPU on FreeBSD Firefox 3.6.8

Post by guido »

Hmm..weird..It seems to hang, trying to connect ("Loading on the tab; Connecting to XX.XX.XX.XX on the bottom line), but a tcpdump reveils the host does send an RST. Same on port 443.
Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.12) Gecko/20100908 Firefox/3.5.12
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: NoScript causes 100% CPU on FreeBSD Firefox 3.6.8

Post by Giorgio Maone »

guido wrote:Hmm..weird..It seems to hang, trying to connect ("Loading on the tab; Connecting to XX.XX.XX.XX on the bottom line), but a tcpdump reveils the host does send an RST. Same on port 443.
What do you mean by "hang"?
How's the CPU usage?
How long does it take to timeout?
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.9) Gecko/20100824 Firefox/3.6.9
guido

Re: NoScript causes 100% CPU on FreeBSD Firefox 3.6.8

Post by guido »

CPU is 100%, timeout is long, certainly more than 2 minuts. When I telnet to port 80, I get an imediate response (connection refused), so it seems to be caused inside firefox.
Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.12) Gecko/20100908 Firefox/3.5.12
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: NoScript causes 100% CPU on FreeBSD Firefox 3.6.8

Post by Giorgio Maone »

guido wrote:CPU is 100%, timeout is long, certainly more than 2 minuts. When I telnet to port 80, I get an imediate response (connection refused), so it seems to be caused inside firefox.
Yes, looks like a Firefox bug: CPU should never go 100% on simple network / wait activity, which should be offloaded asynchronously.
Can you file a bug on https://bugzilla.mozilla.org ?
No need to mention NoScript (it would make reproducing more complicated), just report the 100% CPU when opening your address (and any other address which have no responding web server?)
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.9) Gecko/20100824 Firefox/3.6.9
guido

Re: NoScript causes 100% CPU on FreeBSD Firefox 3.6.8

Post by guido »

Of course I wont mention NOScript ;-)
Filed as bug 595823. Thanks for your effort!
Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.12) Gecko/20100908 Firefox/3.5.12
Post Reply