Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Certain websites cause Firefox to lock up if NoScript is enabled #199

Closed
Foxite opened this issue Jun 16, 2021 · 6 comments
Closed

Certain websites cause Firefox to lock up if NoScript is enabled #199

Foxite opened this issue Jun 16, 2021 · 6 comments

Comments

@Foxite
Copy link

Foxite commented Jun 16, 2021

Be very careful whem copying the below link. Nothing (should) happen when you click it, though.

http://marcgravell.blogspot.co.uk/2012/01/playing-with-your-member.html (It's safe, I promise 😛 )

If you open that page with NoScript enabled, the entire browser more or less hangs. I say "more or less" because it doesn't outright stop responding -- I can still move between tabs and scroll around, but nothing really happens when I click anything. If I scroll far enough in any tab, content stops rendering. It also seems that Javascript in other tabs stops executing - if I have a timer running on Clockify, for instance, it stops updating. While this happens, CPU usage by Firefox will be 100% on a single core, and memory usage will rise indefinitely. This suggest an infinite loop somewhere, along with a memory leak inside it. I doubt that a Firefox extension is supposed to be capable of causing the entire browser to lock up like this, so this may well be a Firefox bug that's triggered by a NoScript bug.

In order to fix this, you need to close Firefox altogether, and then open task manager and wait for the process to end (which it will, eventually; I suspect this is because of some watchdog that kills the process if it sticks around for too long after closing the window), or kill it manually. Then you can restart firefox -- if you don't wait, it will just tell you that the browser is already running but not responding. Note that if have turned on "restore previous session", you may end up in a very difficult situation. I haven't tested that -- and I won't, sorry.

I have confirmed that this problem does not occur when NoScript is disabled. It only happens if NoScript is enabled. My other extensions seem to have no impact on this; I disabled them all, leaving only NoScript enabled, and it would still hang.

You can avoid the problem by pre-emptively adding the page to the list of untrusted websites. Of course, this is impossible if the browser is currently frozen.

I have previously found a different website with this problem -- however, I have not written down the link. If I ever find another website that has this problem I'll be sure to add it to this post.

Edit: If it matters, I'm using Firefox on Arch Linux, with Budgie desktop (which is based on Gnome)

@ghost
Copy link

ghost commented Jul 2, 2021

I have also experienced this with various pages in Firefox. Most recently: https://www.prohavit.com/products/hv-ms55gt-wireless-vertical-mouse

The oom killer steps in eventually and kills the process once it chews through all of available RAM and starts hitting swap.

I did some tracing on the errant PID and Firefox seems to end up stuck in a series of memory allocation and writing the null terminator to file descriptor 15 loops along these lines:

<snip>

mmap(0x7fa251300000, 1048576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fa251300000
mmap(0x7fa2513ff000, 4096, PROT_NONE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fa2513ff000
write(15, "\0", 1)                      = 1
write(15, "\0", 1)                      = 1
write(15, "\0", 1)                      = 1
write(15, "\0", 1)                      = 1
write(15, "\0", 1)                      = 1
write(15, "\0", 1)                      = 1
write(15, "\0", 1)                      = 1
write(15, "\0", 1)                      = 1
write(15, "\0", 1)                      = 1
write(15, "\0", 1)                      = 1
write(15, "\0", 1)                      = 1
write(15, "\0", 1)                      = 1
write(15, "\0", 1)                      = 1
write(15, "\0", 1)                      = 1
write(15, "\0", 1)                      = 1
write(15, "\0", 1)                      = 1
write(15, "\0", 1)                      = 1
write(15, "\0", 1)                      = 1
write(15, "\0", 1)                      = 1
write(15, "\0", 1)                      = 1
write(15, "\0", 1)                      = 1
write(15, "\0", 1)                      = 1
write(15, "\0", 1)                      = 1
write(15, "\0", 1)                      = 1
write(15, "\0", 1)                      = 1
write(15, "\0", 1)                      = 1
write(15, "\0", 1)                      = 1
write(15, "\0", 1)                      = 1
write(15, "\0", 1)                      = 1
write(15, "\0", 1)                      = 1
write(15, "\0", 1)                      = 1
write(15, "\0", 1)                      = 1
write(15, "\0", 1)                      = 1
write(15, "\0", 1)                      = 1
write(15, "\0", 1)                      = 1
write(15, "\0", 1)                      = 1
write(15, "\0", 1)                      = 1
write(15, "\0", 1)                      = 1
write(15, "\0", 1)                      = 1
mprotect(0x2051c94c5000, 4096, PROT_READ|PROT_WRITE) = 0
mprotect(0x2051c94c5000, 4096, PROT_READ|PROT_EXEC) = 0
futex(0x7fa2665056b8, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7fa270f87f38, FUTEX_WAKE_PRIVATE, 1) = 1
write(15, "\0", 1)                      = 1
mprotect(0x2051c94c5000, 4096, PROT_READ|PROT_WRITE) = 0
mprotect(0x2051c94c5000, 4096, PROT_READ|PROT_EXEC) = 0
futex(0x7fa2665056b8, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7fa270f87f38, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7fa2665056b8, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7fa270f87f38, FUTEX_WAKE_PRIVATE, 1) = 1

<snip>

(I redacted the full output, obviously)

Not sure why it's spamming page-sized (and sometimes 1MiB) allocations, then almost immediately unmapping them (but not all of them, hence the leak), and sitting on pthread_mutex ops so often (looks like the scheduler no likey that process' threads?), but maybe that'll help shine some light on the issue in the extension. Possibly some regex related wackiness in NoScript?

Enabling 'unrestricted CSS' on any of the settings doesn't help. Basically the moment I load that site the browser takes a dump and I can watch the Web Content process go wild. With NoScript disabled it doesn't happen.

OS: Ubuntu 20.04 LTS
Kernel: 5.8.0-59-generic
Firefox: 89.0.2 (64-bit)

@Foxite
Copy link
Author

Foxite commented Jul 6, 2021

Another website which appears to have a similar problem: https://abbreviations.com (again, need to copy-paste the link)

Not quite the same problem, as other tabs seem to be unaffected by it, however after you close the tab the resource leak will keep going and you need to end the firefox process to fix it. Like before, you can prevent it by adding the url to the list of untrusted sites.

OS: Arch
Kernel: 5.10.46-1-lts
Desktop: Xorg with KDE
Firefox: 89.0.2

@demostanis
Copy link

Same problem on Pornhub

@Meriipu
Copy link

Meriipu commented Jul 19, 2021

Sounds like this issue #194 ?

hackademix added a commit that referenced this issue Jul 27, 2021
…abled but scripting enabled (not recommended setting) - issue #194, issue #199.
@hackademix
Copy link
Owner

11.2.11rc2 should fix this (at least the OP test case).
Please verify, thank you.

@Foxite
Copy link
Author

Foxite commented Jul 29, 2021

Problem no longer occurs on the link in the OP or abbreviations.com.

@Foxite Foxite closed this as completed Jul 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants