uBlockOrigin / uMatrix-issues

This is the community-maintained issue tracker for uMatrix
https://github.com/gorhill/uMatrix
123 stars 17 forks source link

"TypeError: this.userSettings is undefined"; Pages not loading. #264

Closed chadjoan closed 4 years ago

chadjoan commented 4 years ago

Prerequisites

Description

Running uMatrix in a debugger launched from about:debugging#/runtime/this-firefox causes it to pause on a TypeError. This might also be preventing all webpages from loading.

A specific URL where the issue occurs

No tabs are open in the session, except the about:debugging and toolbox tabs mentioned below. If this prevents page loading, then it has affected every URL that I have tried that isn't an internal firefox tool/mechanism (ex: "about:" pages).

Steps to Reproduce

  1. Navigate to about:debugging#/runtime/this-firefox
  2. Click "Inspect" next to uMatrix extension.
  3. Firefox opens a toolbox tab ("Toolbox - Extension / uMatrix") and soon displays the error ("TypeError: this.userSettings is undefined") while opening tab.js and highlighting line 612 ("this.userSettings.iconBadgeEnabled &&")
  4. If I continue debugging by hitting "Step over", it runs a few more statements and then halts.

Firefox will also not load any webpages while uMatrix is enabled. It will load continuously but never display any content or time out. While this happens, uMatrix will remain "grey" and shows no blocked or passed actions or resources. Disabling uMatrix allows pages to load (ex: I can navigate to google.com and have it load). I am not absolutely sure that this is caused by the TypeError, but it seems to me like this is a fatal exception of some kind that might prevent subsequent steps (ex: page loads) from executing. If it is, this might be related to issue #241 "Unable to load any website on Firefox".

Ruleset

These are all of my rules:

https-strict: behind-the-scene false
matrix-off: about-scheme true
matrix-off: behind-the-scene true
matrix-off: chrome-extension-scheme true
matrix-off: chrome-scheme true
matrix-off: moz-extension-scheme true
matrix-off: opera-scheme true
matrix-off: vivaldi-scheme true
matrix-off: wyciwyg-scheme true
noscript-spoof: * true
referrer-spoof: * true
referrer-spoof: behind-the-scene false
* * * block
* * css allow
* * frame block
* * image allow
* 1st-party * allow
* 1st-party frame allow

I am facing another (seemingly unrelated) issue where IndexedDB data was lost and backups of it cannot be loaded by extensions (tab-session-manager is also hosed). Whether that's related or not, my uMatrix rules were all lost during the past few days (unless I can find a way to recover them from filesystem backups/snapshots). This gives me the clean-slate that you see, and I figured it would be worth mentioning in case it helps you figure out what caused this (ex: if IDB is used, or indirectly required, to construct that userSettings object).

Supporting evidence

Picture of debugger: umatrix-usersettings-updatebadge-crushed

Picture of console after execution halts: umatrix-usersettings-console

Your environment

Firefox compiled with these USE-flags: clang gmp-autoupdate hardened hwaccel jack lto screenshot startup-notification system-av1 system-harfbuzz system-icu system-jpeg system-libevent system-libvpx system-webp wifi

gorhill commented 4 years ago

in case it helps you figure out what caused this (ex: if IDB is used, or indirectly required, to construct that userSettings object).

Something is broken on your side in Firefox's extension framework, usersSettings always exists, it's not created dynamically from IDB.

this might be related to issue #241

It's completely unrelated.

chadjoan commented 4 years ago

Thanks, that's good to know.

sigh This is frustrating; I've already recompiled Firefox in addition to profile wiping to get the freshest start possible, and still have problems, so the non-technical heavy-handed approach already failed. I have no idea how to troubleshoot Firefox's extension framework.

I will try to write a bug report for Firefox.

If you have any idea what I could look at to try and figure out my problem or gather info for a Firefox bug report, I'd appreciate any advice.

Thank you for the prompt response and for making this very flexible security software!

gorhill commented 4 years ago

Try other similar extensions to see if you also suffer issues. Be sure your storage is working fine, a corrupted profile is known to cause storage issues.

uBlock-user commented 4 years ago

https://firefox-storage-test.glitch.me/

test there, post results here.

chadjoan commented 4 years ago

I have tested with a fresh profile now. uMatrix works as long as I don't try to restore any of my IDB data from before the data loss happened. I actually ran uMatrix successfully (with default rules) and then restored Tab-Session-Manager's IDB files (not uMatrix's) and after that uMatrix no longer functioned. I can even disable (and IIRC, remove) Tab-Session-Manager and still have a broken extension environment. Only when I delete the storage/default/moz-extension+++... folders for Tab-Session-Manager does Firefox seem to have a sane extensions environment again (and uMatrix works again).

Here is the Tab-Session-Manager bug report where I am trying to figure out how to get my data back: https://github.com/sienori/Tab-Session-Manager/issues/550

At this point I'm pretty convinced that this is a bug in either Firefox or Tab-Session-Manager. For whatever reason, having (presumably) corrupted IDB files for Tab-Session-Manager can create a broken environment for other, unrelated, extensions (ex: uMatrix). I'm really more inclined to consider it a Firefox bug (at least; maybe it's both), due to the action-at-a-distance and lack of isolation: I would expect that extensions shouldn't be able to affect each other, except by consensual mechanism.

The storage glitch test says things are all good when I run it with a fresh profile and only uMatrix installed: storage-glitch-test-on-fresh-profile

When I attempt to restore Tab-Session-Manager's IDB files, it goes all pear-shaped: storage-test-broken-idb

Notably, I can't have uMatrix running when I test it in the broken configuration. At that point, it really doesn't have anything to do with uMatrix. I can't expect uMatrix to work correctly in a broken environment, and storage seems to become broken by factors that aren't uMatrix.