AdguardTeam / AdguardForiOS

The most advanced ad blocker for iOS
https://adguard.com/
GNU General Public License v3.0
1.43k stars 202 forks source link

Handle the case with too many DNS rules gracefully #2227

Open Zsombe opened 1 year ago

Zsombe commented 1 year ago

In AdGuard iOS when the sum of all DNS rules exceeds approximately 535000 rules. WiFI crashes when this number of rules is exceeded.

ameshkov commented 1 year ago

DnsLibs notifies AdGuard that the engine exceeds the maximum allowed memory limit and it then forcibly stops the tunnel, this may look like a Wi-Fi crash because the tunnel is then restarted due to an "on demand" rule.

The solution would be to start the tunnel anyway with a limited engine instance and notify the user about that via a normal OS notification. The error code that should be used is AGDPE_MEM_LIMIT_REACHED.

Greigh commented 11 months ago

I have this issue on cellar, as well. It just breaks the data functionality of my phone completely. Will 4.6 fix this as well?

ameshkov commented 11 months ago

It will work, but it does not mean that it's a good idea to use a blocklist that's heavier than the limit as all rules above the limit will be discarded.