browser.declarativeNetRequest.* calls throw sometimes, depending on whether a second extension is installed
Categories
(WebExtensions :: Request Handling, defect, P1)
Tracking
(firefox-esr115 wontfix, firefox-esr140 fixed, firefox146 wontfix, firefox147 wontfix, firefox148 fixed)
People
(Reporter: bugzilla, Assigned: robwu)
References
(Regression)
Details
(Keywords: regression, Whiteboard: [addons-jira])
Attachments
(2 files, 1 obsolete file)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-esr140+
|
Details | Review |
Steps to reproduce:
Minimal repro:
- In Developer Edition 147.0b4,
- Disable xpinstall.signatures.required in about:config
- Download main-extension.zip and privacypass-extension.zip from https://github.com/jacobwinters/firefox-declarativeNetRequest-repro
- Install them as extensions
- Visit https://kagi.com
- Restart the browser
- Visit https://kagi.com again
- In about:debugging, inspect the Kagi Search for Firefox extension (main-extension.zip)
- In the extension's console, run browser.declarativeNetRequest.getDynamicRules()
- "Uncaught (in promise) Error: An unexpected error occurred"
- Most other functions on browser.declarativeNetRequest do that too
User-facing version from which it was derived: installing both the Kagi Search for Firefox and Kagi Privacy Pass extensions at the same time breaks the first one's auth functionality, which is implemented through declarativeNetRequest. When the full user-facing problem is happening, steps 8-11 apply unchanged.
Actual results:
Exception thrown from declarativeNetRequest.getDynamicRules.
Browser toolbox console shows the following:
Unexpected non-empty DNRStore data. DNR startupCache data load aborted. 24 ExtensionDNRStore.sys.mjs:1204:11
#promiseStartupCacheLoaded resource://gre/modules/ExtensionDNRStore.sys.mjs:1204
#readStoreDataFromStartupCache resource://gre/modules/ExtensionDNRStore.sys.mjs:1366
_readData resource://gre/modules/ExtensionDNRStore.sys.mjs:1292
#readData resource://gre/modules/ExtensionDNRStore.sys.mjs:1284
#getDataPromise resource://gre/modules/ExtensionDNRStore.sys.mjs:841
#initExtension resource://gre/modules/ExtensionDNRStore.sys.mjs:1155
InterpretGeneratorResume self-hosted:1312
AsyncFunctionNext self-hosted:780
I'm guessing that there's some sort of concurrency bug around that object's _data field that's triggered in the presence of multiple extensions. Not sure how else to explain the way the bug depends on the second extension, which in the minimal repro case is just a manifest file.
Expected results:
I don't think that declarativeNetRequest calls should fail under these conditions.
Comment 1•1 month ago
|
||
The Bugbug bot thinks this bug should belong to the 'WebExtensions::Untriaged' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Comment 2•1 month ago
|
||
I'll investigate.
| Assignee | ||
Comment 3•26 days ago
|
||
What happens here is as follows:
- We load an extension that does not have any DNR rules. That causes the extension's StartupCache to be populated with the knowledge that the extension does not have any rules.
- We load another extension with rules (whether static or dynamic).
- After restarting Firefox, we see the first extension without rules, and as an optimization skip the more expensive full initialization, and partially initialize
_data(link to#initExtensionimplementation). - However, when the second extension starts up, as yet another optimization we attempt to read the parsed rules (from another startup cache file) (entry point). This commences the full initialization from cached data, but the logic there assumes that we have not initialized any data yet. Because we did initialize (empty) data for an extension, that check fails and we raise an error (link to
#promiseStartupCacheLoadedimplementation).
We should accept this scenario and not raise an error in this case.
Updated•26 days ago
|
Comment 4•26 days ago
|
||
Set release status flags based on info from the regressing bug 1921353
| Assignee | ||
Comment 5•26 days ago
|
||
| Assignee | ||
Updated•26 days ago
|
Updated•26 days ago
|
Updated•25 days ago
|
Comment 8•24 days ago
|
||
| bugherder | ||
| Assignee | ||
Comment 9•20 days ago
|
||
Original Revision: https://phabricator.services.mozilla.com/D278132
Updated•20 days ago
|
Comment 10•20 days ago
|
||
firefox-esr140 Uplift Approval Request
- User impact if declined: The declarativeNetRequest extension API fails to initialize after a browser restart, when two or more extensions use this API. The exact conditions are described in https://bugzilla.mozilla.org/show_bug.cgi?id=2006233#c3
- Code covered by automated testing: yes
- Fix verified in Nightly: yes
- Needs manual QE test: no
- Steps to reproduce for manual QE testing: Not needed, but provided in the bug report.
- Risk associated with taking this patch: low
- Explanation of risk level: Fix in DNR implementation covered by automated tests.
- String changes made/needed: None
- Is Android affected?: yes
| Assignee | ||
Comment 11•20 days ago
|
||
Original Revision: https://phabricator.services.mozilla.com/D278132
Updated•20 days ago
|
Comment 12•20 days ago
|
||
firefox-esr115 Uplift Approval Request
- User impact if declined: The declarativeNetRequest extension API fails to initialize after a browser restart, when two or more extensions use this API. The exact conditions are described in https://bugzilla.mozilla.org/show_bug.cgi?id=2006233#c3
- Code covered by automated testing: yes
- Fix verified in Nightly: yes
- Needs manual QE test: no
- Steps to reproduce for manual QE testing: Not needed, but provided in the bug report.
- Risk associated with taking this patch: low
- Explanation of risk level: Fix in DNR implementation covered by automated tests.
- String changes made/needed: None
- Is Android affected?: yes
Updated•18 days ago
|
Updated•18 days ago
|
Comment 13•18 days ago
|
||
| uplift | ||
Updated•18 days ago
|
Updated•18 days ago
|
Description
•