Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Adblock init crash #8334

Closed
iccub opened this issue Oct 30, 2023 · 3 comments
Closed

Adblock init crash #8334

iccub opened this issue Oct 30, 2023 · 3 comments

Comments

@iccub
Copy link
Contributor

iccub commented Oct 30, 2023

Description:

Steps to Reproduce

  1. Run the app, enable a lot of Filters in Brave Shields -> Privacy
  2. You can enable up to 40 at the moment.

Actual result:

  • Crash

Expected result:

  • Should not crash at all

Reproduces how often: [Easily reproduced, Intermittent Issue]

  • Very difficult to reproduce on new devices! (Easy to reproduce on iPhone 6, 6s, SE or older devices)

Brave Version:

  • 1.58.x, 1.58.1

Device details:

  • iPhone
Zrzut ekranu 2023-10-30 o 17 04 23
@iccub iccub added this to the 1.58.1 milestone Oct 30, 2023
@iccub iccub pinned this issue Oct 30, 2023
@iccub iccub closed this as completed Oct 30, 2023
@iccub
Copy link
Contributor Author

iccub commented Oct 30, 2023

test plan here #8294

@Uni-verse
Copy link
Contributor

Uni-verse commented Oct 30, 2023

Verified via #8294 (comment) & #8294 (comment).

@cuba
Copy link
Contributor

cuba commented Nov 1, 2023

Just a summary of the progress of this issue:

Original issue (this issue)

This happened because I was eagerly compiling all engines and content blockers. Note this is change from 1.57 which didn't do this
Important: While it seems that eagerly compiling the engines causes the issue, this doesn't seem to be the case. You could have enabled all filter lists in 1.57 and nothing would crash. I believe that it's just an unhappy coincidence that, while adding the eager compile, something else also changed which caused the crashes and this change only exacerbated the effect.

STR

Launch on an old device. Crashes.

Patch 1

#8193
I removed the eager compile of engines. Fixed crashes locally but not on the app store

STR

Enable a large number of filter lists (more than 40 on iphone 6s)

Patch 2

  1. Fix #8191: Fix crashes due to compiling too many engines, too quickly #8224 (hard limit of 30),
  2. Fix #8277: Fix crashes on old devices due to too many filter lists enabled #8283 (limit based on device memory)
  3. Fix #8292: Change the minimum number of engines available #8288 (add a minimum of 20)

Limit the number of enabled filter lists (the limit is based on the device memory with a 20 minimum)

STR

At this point there is no more an STR so I built a tool to be able to reproduce the STR in Patch 1 (i.e circumvent the filter list limit) #8351

Patch 3

#8295
Content blockers are eagerly compiled so i made sure they are not (this wasn't based on anything except a dumb attempt to limit the memory usage of the app. This is just a "hopeful fix")

STR

Same as Patch 2.

Some mysteries

  1. Compiling the same filter list (even a large one 100 times) doesn't crash the app.
  2. Compiling filter lists on detached tasks pushes the amount of filter lists on iPhone 6s from 40 to 90 (seems to only be a fluke)
  3. Often crashes on the Russian list. I tried to brute force compile this one thinking it can be the reason, but it seems to only crash on this one because its the largest filter list so an obvious bottle neck. So I don't believe that this list specifically is the problem. Though some people have said that disabling this filter list fixes the crashes.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants