Firefox hangs every few seconds (infinite/recursive loop error)

RESOLVED INVALID

Status

()

Firefox
Untriaged
RESOLVED INVALID
a year ago
7 months ago

People

(Reporter: Anonymous, Unassigned)

Tracking

({hang})

50 Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(4 attachments)

(Reporter)

Description

a year ago
Created attachment 8823141 [details]
firefox.txt

User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:50.0) Gecko/20100101 Firefox/50.0
Build ID: 20161208153507

Steps to reproduce:

Firefox hangs every few seconds, especially when clicking on a tab (including about:addons) or when browsing any web pages (including google.com or the mozilla site).

I used the program "whatishang" to generate a report and it said that there were infinite, very long or recursive loops. I have attached the full report to this ticket.

Hang report for C:\Program Files\Mozilla Firefox\firefox.exe
Generated by using WhatIsHang on 3/1/2017 8:44:58 AM
Web site: http://www.nirsoft.net


Remarks:
* The program probably hangs because there is an infinite loop, very long loop, or recursive calls.


Strings found in the stack:
interposeProperty
dom.use_watchdog
STATUS_PRIVILEGED


Modules found in the stack:
C:\Program Files\Mozilla Firefox\xul.dll , Mozilla Foundation , Firefox, 
C:\Windows\system32\KERNELBASE.dll , Microsoft Corporation , Microsoft® Windows® Operating System, Windows NT BASE API Client DLL
C:\Program Files\Mozilla Firefox\mozglue.dll , Mozilla Foundation , Firefox, 


Actual results:

Firefox hangs every few seconds, especially when clicking on a tab (including about:addons) or when browsing any web pages (including google.com or the mozilla site).


Expected results:

Firefox should not be hanging every few seconds.

Comment 1

a year ago
Did you test in safe mode?
https://support.mozilla.org/en-US/kb/troubleshoot-firefox-issues-using-safe-mode
Keywords: hang

Comment 2

11 months ago
Also creating a new profile, I think this can help, you have the steps here:https://support.mozilla.org/en-US/kb/profile-manager-create-and-remove-firefox-profiles?redirectlocale=en-US&redirectslug=Managing-profiles#w_starting-the-profile-manager
(Reporter)

Comment 3

11 months ago
(In reply to Loic from comment #1)
> Did you test in safe mode?
> https://support.mozilla.org/en-US/kb/troubleshoot-firefox-issues-using-safe-
> mode

Yes, im not sure if the problem is still present. Have you tried looking at the hang report that I have provided? It should provide some clues as to what is causing it.
(Reporter)

Comment 4

11 months ago
(In reply to ovidiu boca[:Ovidiu] from comment #2)
> Also creating a new profile, I think this can help, you have the steps
> here:https://support.mozilla.org/en-US/kb/profile-manager-create-and-remove-
> firefox-profiles?redirectlocale=en-US&redirectslug=Managing-
> profiles#w_starting-the-profile-manager

Have you tried looking at the hang report that I have provided? It should provide some clues as to what is causing it.

Comment 5

11 months ago
First we need to be sure that you issue is not caused by and add-on or some pref changes in the profile, that's way we suggest you to try the above steps. Thanks
(Reporter)

Comment 6

11 months ago
(In reply to ovidiu boca[:Ovidiu] from comment #5)
> First we need to be sure that you issue is not caused by and add-on or some
> pref changes in the profile, that's way we suggest you to try the above
> steps. Thanks

Even if the problem doesnt occur on a clean firefox installation, that doesnt really prove anything. It might be that a firefox update has changed something that causes all addons that do something to cause firefox to hang repeatedly. Or it might be that -any- addons installed now causes it to hang.

You may as well tell people to do a clean installation of windows to "prove" that its not a windows related problem.

I tested it with a new profile and in safe mode. It "seems" to hang less but i do not know if this is simply because firefox has less addons to work with or anything.

Can you please take a look at the hang report?

Comment 7

11 months ago
Mike can you please take a look at the hang report? Can you do something with it or it should be a cleopatra profile? 


Anonymous if you can't reproduce your issue in safe mode I think that some add-on is causing this problem. If you don't have many add-ons you can disable one by one and see which one is causing the hang. All the add-ons are the responsibility of the developers how build them to make sure that are compatible with FF.  

You can use this link to capture a cleopatra profile https://new.cleopatra.io/
Flags: needinfo?(mconley)
I'm afraid the hang report isn't really useful - the unsymbolicated stacks aren't much to go on.

I do see mentions about "interpose" and "observer" in the memory dump. This suggests that an add-on is going over the add-on shims, and this is causing the issue.

There are a few ways to strengthen this hypothesis:

1) Temporarily set extensions.interposition.enabled to false, and restart the browser. This disables the add-on shims. If the lag cannot be reproduced, then the add-on shims are at fault.
2) Gather a profile using the Gecko Profiler add-on, which will show us what is blocking the main thread.

(1) is probably easiest. I'm willing to put good money on this being an incompatible add-on issue.
Flags: needinfo?(mconley)

Comment 9

11 months ago
Thank you very much for your effort and suggestions.

Anonymous please follow the suggestion from Mike's comment 8.
Flags: needinfo?(question2005)
(Reporter)

Comment 10

11 months ago
(In reply to Mike Conley (:mconley) from comment #8)
> I'm afraid the hang report isn't really useful - the unsymbolicated stacks
> aren't much to go on.
> 
> I do see mentions about "interpose" and "observer" in the memory dump. This
> suggests that an add-on is going over the add-on shims, and this is causing
> the issue.
> 
> There are a few ways to strengthen this hypothesis:
> 
> 1) Temporarily set extensions.interposition.enabled to false, and restart
> the browser. This disables the add-on shims. If the lag cannot be
> reproduced, then the add-on shims are at fault.
> 2) Gather a profile using the Gecko Profiler add-on, which will show us what
> is blocking the main thread.
> 
> (1) is probably easiest. I'm willing to put good money on this being an
> incompatible add-on issue.

Thanks for the help. What are "add-on shims"? I trierd setting that interposition thing to false, restarted firefox, but it is still hanging.

I tried to use the gecko profiler thing, I dont know if the results are accurate or contain what you are looking for, I tried to use the share button but it just kept saying "error 0 occured while uploading file".

Im going to try and upload the file as an attachment.
(Reporter)

Comment 11

11 months ago
Created attachment 8830074 [details]
iDJ_5i8j

Gecko profiler file.
(Reporter)

Comment 12

11 months ago
(In reply to Mike Conley (:mconley) from comment #8)
> I'm afraid the hang report isn't really useful - the unsymbolicated stacks
> aren't much to go on.
> 
> I do see mentions about "interpose" and "observer" in the memory dump. This
> suggests that an add-on is going over the add-on shims, and this is causing
> the issue.
> 
> There are a few ways to strengthen this hypothesis:
> 
> 1) Temporarily set extensions.interposition.enabled to false, and restart
> the browser. This disables the add-on shims. If the lag cannot be
> reproduced, then the add-on shims are at fault.
> 2) Gather a profile using the Gecko Profiler add-on, which will show us what
> is blocking the main thread.
> 
> (1) is probably easiest. I'm willing to put good money on this being an
> incompatible add-on issue.

Second gecko profiler file (different from the attachment i uploaded earlier) : https://cleopatra.io/#report=a0e198a59e9bbed8b0b4da4e8a73079d43d1686b
(Reporter)

Comment 13

11 months ago
(In reply to Mike Conley (:mconley) from comment #8)
> I'm afraid the hang report isn't really useful - the unsymbolicated stacks
> aren't much to go on.
> 
> I do see mentions about "interpose" and "observer" in the memory dump. This
> suggests that an add-on is going over the add-on shims, and this is causing
> the issue.
> 
> There are a few ways to strengthen this hypothesis:
> 
> 1) Temporarily set extensions.interposition.enabled to false, and restart
> the browser. This disables the add-on shims. If the lag cannot be
> reproduced, then the add-on shims are at fault.
> 2) Gather a profile using the Gecko Profiler add-on, which will show us what
> is blocking the main thread.
> 
> (1) is probably easiest. I'm willing to put good money on this being an
> incompatible add-on issue.

Third gecko profiler file : https://cleopatra.io/#report=4f7ac292e697370141726a09f42e290a451522f1
Ah - these profiles are great! What these are showing me is that Firefox is pausing for long garbage collections and cycle collections. This usually happens when Firefox has consumed a lot of memory, and so the "graph" of things it has to search through to find garbage is large.

When you get into this state, can you go to about:memory and gather / post a memory report?
(Reporter)

Comment 15

11 months ago
Created attachment 8830306 [details]
memory-report.json.gz

Memory report
(Reporter)

Comment 16

11 months ago
(In reply to Mike Conley (:mconley) from comment #14)
> Ah - these profiles are great! What these are showing me is that Firefox is
> pausing for long garbage collections and cycle collections. This usually
> happens when Firefox has consumed a lot of memory, and so the "graph" of
> things it has to search through to find garbage is large.
> 
> When you get into this state, can you go to about:memory and gather / post a
> memory report?

Not sure if this is accurate, but I just uploaded a memory report.
(Reporter)

Comment 17

11 months ago
Created attachment 8830318 [details]
memory-report.json.gz

Second memory report
Hey erahm, anything particularly illuminating in these memory reports? Anything that might explain why Anonymous is GC'ing so much?
Flags: needinfo?(erahm)
tl;dr disable the CanvasBlocker add-on, that should fix things.

Interesting snippets:

> ├────263.10 MB (15.35%) -- window-objects
> │    ├──184.11 MB (10.74%) ++ (676 tiny)
> 
> ├────147.06 MB (08.58%) -- add-ons
> │    ├──117.97 MB (06.88%) ++ CanvasBlocker@kkapsner.de/js-non-window/zones/zone(0x7f4800)
> 
> 5,980 (100.0%) -- js-main-runtime-compartments
> ├──5,239 (87.61%) -- system
> │  ├────687 (11.49%) ── [System Principal], Addon-SDK (from: resource://gre/modules/commonjs/toolkit/loader.js:420) [687]
> │  ├────680 (11.37%) ── [System Principal], resource://canvasblocker-at-kkapsner-dot-de/lib/callingStack.js (from: resource://gre/modules/commonjs/toolkit/loader.js:420) [680]
> │  ├────679 (11.35%) ── [System Principal], resource://canvasblocker-at-kkapsner-dot-de/lib/askForPermission.js (from: resource://gre/modules/commonjs/toolkit/loader.js:420) [679]
> │  ├────679 (11.35%) ── [System Principal], resource://canvasblocker-at-kkapsner-dot-de/lib/intercept.js (from: resource://gre/modules/commonjs/toolkit/loader.js:420) [679]
> │  ├────679 (11.35%) ── [System Principal], resource://canvasblocker-at-kkapsner-dot-de/lib/modifiedAPI.js (from: resource://gre/modules/commonjs/toolkit/loader.js:420) [679]
> │  ├────679 (11.35%) ── [System Principal], resource://canvasblocker-at-kkapsner-dot-de/lib/randomSupplies.js (from: resource://gre/modules/commonjs/toolkit/loader.js:420) [679]
> │  ├────676 (11.30%) ── [System Principal], inProcessTabChildGlobal?ownedBy=chrome://browser/content/browser.xul [676]

It appears CanvasBlocker is creating at least 7 compartments per tab, you seem to have 676 "tiny" top level windows open (it's possible CanvasBlocker is causing these to leak, which would be my guess) which means your not going to have a very good time.
Flags: needinfo?(erahm)
And I guess this is already known: https://github.com/kkapsner/CanvasBlocker/issues/100
(Reporter)

Comment 21

11 months ago
(In reply to Eric Rahm [:erahm] from comment #19)
> tl;dr disable the CanvasBlocker add-on, that should fix things.
> 
> Interesting snippets:
> 
> > ├────263.10 MB (15.35%) -- window-objects
> > │    ├──184.11 MB (10.74%) ++ (676 tiny)
> > 
> > ├────147.06 MB (08.58%) -- add-ons
> > │    ├──117.97 MB (06.88%) ++ CanvasBlocker@kkapsner.de/js-non-window/zones/zone(0x7f4800)
> > 
> > 5,980 (100.0%) -- js-main-runtime-compartments
> > ├──5,239 (87.61%) -- system
> > │  ├────687 (11.49%) ── [System Principal], Addon-SDK (from: resource://gre/modules/commonjs/toolkit/loader.js:420) [687]
> > │  ├────680 (11.37%) ── [System Principal], resource://canvasblocker-at-kkapsner-dot-de/lib/callingStack.js (from: resource://gre/modules/commonjs/toolkit/loader.js:420) [680]
> > │  ├────679 (11.35%) ── [System Principal], resource://canvasblocker-at-kkapsner-dot-de/lib/askForPermission.js (from: resource://gre/modules/commonjs/toolkit/loader.js:420) [679]
> > │  ├────679 (11.35%) ── [System Principal], resource://canvasblocker-at-kkapsner-dot-de/lib/intercept.js (from: resource://gre/modules/commonjs/toolkit/loader.js:420) [679]
> > │  ├────679 (11.35%) ── [System Principal], resource://canvasblocker-at-kkapsner-dot-de/lib/modifiedAPI.js (from: resource://gre/modules/commonjs/toolkit/loader.js:420) [679]
> > │  ├────679 (11.35%) ── [System Principal], resource://canvasblocker-at-kkapsner-dot-de/lib/randomSupplies.js (from: resource://gre/modules/commonjs/toolkit/loader.js:420) [679]
> > │  ├────676 (11.30%) ── [System Principal], inProcessTabChildGlobal?ownedBy=chrome://browser/content/browser.xul [676]
> 
> It appears CanvasBlocker is creating at least 7 compartments per tab, you
> seem to have 676 "tiny" top level windows open (it's possible CanvasBlocker
> is causing these to leak, which would be my guess) which means your not
> going to have a very good time.

Thanks for the help!
Sounds like we've tracked this one down as an add-on problem (CanvasBlocker). The add-on is already tracking this (see comment 20). Thanks erahm, and thanks Anonymous for going through these debugging steps!
Status: UNCONFIRMED → RESOLVED
Last Resolved: 11 months ago
Resolution: --- → INVALID
(Reporter)

Updated

7 months ago
Flags: needinfo?(question2005)
You need to log in before you can comment on or make changes to this bug.