AdguardBrowserExtension
AdguardBrowserExtension copied to clipboard
When AdGuard crashes, it resets settings, leaving you with all filters disabled
AdGuard Extension version
4.2.209
Browser version
Firefox 120 beta
OS version
Ubuntu 22.04.3
What filters do you have enabled?
irrelevant for the issue, as this is a settings storage issue
What Stealth Mode options do you have enabled?
irrelevant for the issue, as this is a settings storage issue
Issue Details
AdGuard loses settings and filter selections when AdGuard extension process crashes or is forcibly killed. I have filters and then suddenly find myself with all filters disabled.
Expected Behavior
Settings survive crashes
Screenshots
No response
Additional Information
Occasionally, whole Firefox can crash due to AdGuard
@Birbber should be P1 or P2, as this basically makes it unusable
Hello @erkinalp,
Thank you for your report. It is expected behavior that if the settings of the AdGuard extension are corrupted during a browser crash, they will be restored to their default state. This is a safeguard to prevent further issues arising from corrupted settings.
If you are able to provide logs from the background page of the extension after a crash, it might help us understand more about what is happening. Your cooperation in this matter is greatly appreciated and can assist in improving the extension's reliability.
It is expected behavior that if the settings of the AdGuard extension are corrupted during a browser crash, they will be restored to their default state.
No other extension does that, and the default state makes it with no filters enabled, rather than all default filters enabled, which immediately amplifies CPU time and network traffic due to ads loading. Instead, if the extension is crashed, settings should be validated and valid values used as-is, and only invalid values restored to defaults. This may however require using a hand-rolled fault-tolerant parser, rather than the web browser's standard library parsers.
If you are able to provide logs from the background page of the extension after a crash, it might help us understand more about what is happening. Your cooperation in this matter is greatly appreciated and can assist in improving the extension's reliability.
Will try in the next crash.
I opened the log window and hit "store the log", how to export the log file?
Here you can find instructions https://maximtop.notion.site/How-to-export-logs-from-the-background-page-in-the-extension-fb7e2fe23cb0451ea010672ce0570929?pvs=4
thanks, Unfortunately, it didn't become clear from the logs. Do you have the steps to reproduce the crash?
Oh, just enable filters and open lots of tabs, using the browser for a very long time, do not close the browser except for upgrading (even then, kill the main process of the browser instead of properly closing it) and continue browsing session across upgrades (of both your browser and AdGuard, from the session you just killed before installing the upgrade).
And it happens only when AdGuard is enabled?
Other extensions do not reset settings on crash such aggressively, hence they can be restored to normal operation by reloading the affected tabs. AdGuard requires additional intervention. Hence the suggestion to use a fault-tolerant settings parser.
I'm asking to understand if it crashes the AdGuard extension or the Firefox browser. If the browser, then does it crash without the AdGuard extension?
If any of tabs crash, it eventually leads to a complete crash of the whole browser if I do not reload or close affected tabs in a timely manner. It takes longer without AdGuard, but AdGuard does visibly crash even when the rest of browser processes do not, in fact I have firsthand observed AdGuard crashing and it resetting to default settings (thanks to "auto-activate filters" settings, and I happen to use my computer in Turkish), then me rushing to reload tabs one by one to prevent complete browser crash.
another log Has various unhandled exceptions.
another log Has various unhandled exceptions.
Is there a stack trace available?
2023-11-17T13:52:17:264: Cannot initialize settings from storage: An unexpected error occurred.
Stack trace:
background.js:27010:24
If not, then I will provide you with a development version that includes more detailed logs.
Sadly no. Can you provide a debug version?
Cannot initialize settings from storage
I've sent you email.
developer version with same settings, this time with the correct log
There is no error Cannot initialize settings from storage
Also, I see there are a lot of invalid rules, can you share what filters are you using?
AdGuard Browser extension has nothing to do with this filter https://raw.githubusercontent.com/Yuki2718/adblock2/main/medium_mode/dynamic-rules.txt
OK, disabled that one
Yeah, I see the error that's occurring, but it's the same one you sent previously. I need the error from the dev build because it contains extended logs.
Do you have any more recent build? I was able to reproduce it in 4.2.220 (the development branch), but for some reason, not reflected in the logs, maybe because it is a temporary installation.
maybe because it is a temporary installation.
Here is the instruction of how to test. https://extensionworkshop.com/documentation/develop/testing-persistent-and-restart-features/#what-do-i-do-to-ensure-i-can-test-my-extension
While I had not managed to pinpoint the reason of the crash, there is a possible solution of not resetting to defaults after a crash (#2604)
Worse than I thought: Manually disabling and re-enabling the extension also leaves you in that state with all filters disabled.
Worse than I thought: Manually disabling and re-enabling the extension also leaves you in that state with all filters disabled.
I've tried disabling and enabling the extension but wasn't able to reproduce the issue. If it's easily reproducible on your end, could you please capture the logs for the new build I've sent you via email and share them with me?