NoScript takes up over 100% of CPU

Bug reports and enhancement requests
monkeyrunner
Posts: 2
Joined: Sun Jul 11, 2021 1:21 pm

NoScript takes up over 100% of CPU

Post by monkeyrunner »

Hey everyone,

for the last few days my chrome has been acting really weird, it was super slow for no reason and used up over 100% of the CPU, even when running in the background. I looked at htop and saw the command of the process including something like "secure payment confirmation" (probably this? https://www.chromestatus.com/feature/5702310124584960). After killing the process, it turns out that the PID was for NoScript. I removed the plugin and now my chrome is running fine again.

Any explanations for this odd behaviour? Thanks in advance.
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36
User avatar
Giorgio Maone
Site Admin
Posts: 9454
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: NoScript takes up over 100% of CPU

Post by Giorgio Maone »

monkeyrunner wrote: Sun Jul 11, 2021 1:27 pm After killing the process, it turns out that the PID was for NoScript.
Could you tell me how exactly did you determine this? Browser extensions don't have an identifiable PID of theirs, AFAIK...
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0
monkeyrunner
Posts: 2
Joined: Sun Jul 11, 2021 1:21 pm

Re: NoScript takes up over 100% of CPU

Post by monkeyrunner »

Giorgio Maone wrote: Sun Jul 11, 2021 1:59 pm
monkeyrunner wrote: Sun Jul 11, 2021 1:27 pm After killing the process, it turns out that the PID was for NoScript.
Could you tell me how exactly did you determine this? Browser extensions don't have an identifiable PID of theirs, AFAIK...
After killing the process, Google Chrome told me that NoScript quit. Also after removing the plugin everything went back to normal.
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36
User avatar
Giorgio Maone
Site Admin
Posts: 9454
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: NoScript takes up over 100% of CPU

Post by Giorgio Maone »

monkeyrunner wrote: Sun Jul 11, 2021 2:08 pm After killing the process, Google Chrome told me that NoScript quit. Also after removing the plugin everything went back to normal.
OK, could you try to reproduce (or tell me how to reproduce) and give me the exact message Chrome gives you? Thanks.
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0
plans
Posts: 2
Joined: Wed Jul 14, 2021 4:52 am

Re: NoScript takes up over 100% of CPU

Post by plans »

Noticed same 100% CPU usage issue from last week on both of MacOS and Win10.

Setup: Win10, Chrome 91.0.4472.124, NoScript 11.2.9
Config: Select everything inside the NoScript config -> General -> DEFAULT so that everything is allowed by default.

Visit this website: https://www.mysmth.net/nForum/#!board/EnglishWorld
For reference please check image: https://ibb.co/VpCFX9X click those post one by one in the black square then should be able to reproduce the issue.

Inside Chrome task manager can see the extension PID and CPU usage, please check image : https ://ibb.co/9G0cGtK (antispam filter don't allow me to post this URL)

If directly open those posts by copy/paste URL one by one then can't reproduce the issue. I can only reproduce the issue by click the link into the post.
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36
User avatar
Giorgio Maone
Site Admin
Posts: 9454
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: NoScript takes up over 100% of CPU

Post by Giorgio Maone »

plans wrote: Wed Jul 14, 2021 5:17 am Noticed same 100% CPU usage issue from last week on both of MacOS and Win10.

Setup: Win10, Chrome 91.0.4472.124, NoScript 11.2.9
Thank you very much for your detailed reproduction steps.
Unfortunately I didn't manage to reproduce at all on my side (NoScript's process CPU staid literally at 0), with the only difference I was running Linux and Chromium (same version as yours).
In the evening I should be able to try on Windows 10 and Mac OS as well, even though an O.S.-specific issue rarely seen in modern WebExtensions.
In the meanwhile can you confirm that
  1. You can reproduce with no other extension installed
  2. The only difference from a "stock" NoScript configuration is having the DEFAULT preset with all the capability checkboxes checked
  3. The site must be opened in an Incognito window
  4. The posts must be opened by clicking on the envelope icon on their left (I tried both this and using the three-fingers gesture to open them in a background tab, so I could spawn the tabs more quickly in case it made a difference)
Thanks again!
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0
plans
Posts: 2
Joined: Wed Jul 14, 2021 4:52 am

Re: NoScript takes up over 100% of CPU

Post by plans »

Yes, can reproduce with no other extension installed.

Tried to reset the NoScript config, and add that mysmth.net to the TRUST list, can also reproduce the issue.

It doesn't have to be Incognito. Tried normal window can also reproduce the issue.

Doesn't have to click the envelope icon on the left, can reproduce the issue by either way. Just click one or two maybe not enough to reproduce the issue, maybe need to click a dozen, also can click some other things for example the top left side picture to go to the main page of the website and click other posts.
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36
User avatar
Giorgio Maone
Site Admin
Posts: 9454
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: NoScript takes up over 100% of CPU

Post by Giorgio Maone »

Update: I've managed to reproduce on Windows 10.

Abnormal and sustained CPU spike in the NoScript process by just opening the first of the posts (in stark contrast of what I've seen on Linux).

Unfortunately, trying to using the devtools profiler just added mystery to this issue: over 12 seconds of profiling only 162ms were reported to be spent in NoScript's code.

So, it seems to be
  • An OS-specific (Chrome?) bug
  • Triggered by some script in the page which causes Chrome's internals (inter-process communication?) or Chrome's extensions API (not NoScript's own code) to use a lot of CPU in NoScript's extension background process.
Best part: after 3 or for reloads the reported CPU usage went to 0 and stayed there.

So, investigation goes on to understand what's actually going on under the hood.
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0
User avatar
therube
Ambassador
Posts: 7922
Joined: Thu Mar 19, 2009 4:17 pm
Location: Maryland USA

Re: NoScript takes up over 100% of CPU

Post by therube »

(FWIW, unable to reproduce in FF 90, Win7, NoScript 11.2.9.)
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball NoScript FlashGot AdblockPlus
Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0 SeaMonkey/2.53.9
qwertyasdfgh
Posts: 3
Joined: Sat Jul 17, 2021 1:48 am

Re: NoScript takes up over 100% of CPU

Post by qwertyasdfgh »

Hey just created an account to report the same thing happening on MacOS. My fans have been going crazy for the last week and whenever I open Activity Monitor -> Energy tab it shows "Google Chrome Helper (Renderer)" going crazy. When I kill the process I get a notification that NoScript has crashed. Sometimes there is another renderer process that is also quite high that is usually a tab, but I haven't found a pattern to it so far.

NoScript 11.2.9
Chrome Version 89.0.4389.72
MacOS 10.15.4

If there is anything I can do to profile this more precisely let me know, I'm happy to install from source and poke around.
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.72 Safari/537.36
ptheborg
Posts: 5
Joined: Sat Jul 17, 2021 1:30 pm

Re: NoScript takes up over 100% of CPU

Post by ptheborg »

Same issue here on MacOS since a week or so.
I noticed that going to the extension overview and disabling and reenabling the NoScript, makes the 100%+ process go away.
It also seems that this happens when I am downloading files concurrently, like say 6 or 10 files, maybe NoScript crashes due to that? This was not a problem before last week. (previously I thought it might have been due to the file size but I tested it just now with smaller files and the same problem occurs).

NoScript 11.2.9
BraveBrowser Version 1.26.77 Chromium: 91.0.4472.164 (Official Build) (x86_64)
MacOS Big Sur 11.4 apparently this is also known as 10.15.7 ? hmmm

Really hope this can get sorted as this is still definitely the best script blocking extension out there.
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36
qwertyasdfgh
Posts: 3
Joined: Sat Jul 17, 2021 1:48 am

Re: NoScript takes up over 100% of CPU

Post by qwertyasdfgh »

Was able to catch it and profile it, hopefully this helps: https://github.com/hackademix/noscript/issues/205. Let me know if I can do/share anything else.
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.72 Safari/537.36
User avatar
Giorgio Maone
Site Admin
Posts: 9454
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: NoScript takes up over 100% of CPU

Post by Giorgio Maone »

qwertyasdfgh wrote: Mon Jul 19, 2021 9:24 pm Was able to catch it and profile it, hopefully this helps: https://github.com/hackademix/noscript/issues/205. Let me know if I can do/share anything else.
That's extremely helpful, thank you!
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0
User avatar
Giorgio Maone
Site Admin
Posts: 9454
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: NoScript takes up over 100% of CPU

Post by Giorgio Maone »

Everybody here, please check https://github.com/hackademix/noscript/ ... -884539982

Thanks!
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0
ptheborg
Posts: 5
Joined: Sat Jul 17, 2021 1:30 pm

Re: NoScript takes up over 100% of CPU

Post by ptheborg »

Giorgio Maone wrote: Wed Jul 21, 2021 10:30 pm Everybody here, please check https://github.com/hackademix/noscript/ ... -884539982

Thanks!
Thanks! I can confirm that the cpu hog problem seems to have been squashed with this build.
I have tried it out with:
Brave Version 1.26.77 Chromium: 91.0.4472.164 (Official Build) (x86_64)
MacOS 11.4 / 10.15.7
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36
Post Reply