brave / brave-browser

Brave browser for Android, iOS, Linux, macOS, Windows.
https://brave.com
Mozilla Public License 2.0
17.52k stars 2.27k forks source link

crash in certain cases when enabling `search promo` and `Show suggested sites in autocomplete` #25059

Closed kjozwiak closed 2 years ago

kjozwiak commented 2 years ago

Description

While running through https://github.com/brave/brave-core/pull/14350#issuecomment-1231063327, I ran into a crash when enabling Show suggested sites in autocomplete and then restarting the browser in certain cases. Once you get into the scenario mentioned below, Brave will crash every time you tap on the URL bar. Some of the crashes from brave://crashes:

Steps to reproduce

Prerequisite: ensure that you're part of either US, CA, DE, FR, UK, AT, ES or MX

  1. launch with a clean profile and run through onboarding (in this case, I set Brave as the default browser)
  2. go into Settings -> Search engines and change the Standard tab to something else other than Brave
  3. go into Developer options -> QA Preferences
  4. tap on Command Line String and add --enable-features=BraveSearchOmniboxBanner (tap on Relaunch Now)
  5. tap on the URL bar and type in motorsport.com and tap on Go (should also see the promo card)
  6. once motorsport.com loads, go into Settings -> Brave Shields & privacy
  7. enable Show suggested sites in autocomplete
  8. press the X to close the Settings page (should now be on the motorsport.com tab)
  9. re-launch Brave (ensure that motorsport.com is the active tab)
  10. tap in the omnibox and Brave will crash every single time

Actual result

https://user-images.githubusercontent.com/2602313/187335829-2c1c3249-d4ef-48c4-8cc3-2ec662db0a27.mp4

Expected result

Brave shouldn't be crashing when user(s) tap on the omnibox when both search promo and Show suggested sites in autocomplete are enabled.

Issue reproduces how often

100% reproducible when using the STR/Cases outlined above.

Version/Channel Information:

Device details

Brave version

Brave | 1.45.10 Chromium: 105.0.5195.68 (Official Build) canary (32-bit)
--- | ---
Revision | ad13e82529051bac6a0e65f455e6d7a1e5fd7938-refs/branch-heads/5195@{#903}
OS | Android 12; Build/SP1A.210812.016

Website problems only

Additional information

kjozwiak commented 2 years ago

@deeppandya you don't even need to enable Show suggested sites in autocomplete as I just reproduced the issue without even enabling Show suggested sites in autocomplete but can't get the STR/Cases 100%. Seems like it's some type of race condition and when you tap in the URL quickly after a restart, Brave will crash when tapping on the omnibox.

But with the STR/Cases above, you should be able to reproduce 100%.

kjozwiak commented 2 years ago

Because https://github.com/brave/brave-core/pull/14886 had major refactor changes to fix the above crash, QA went through STR/Cases mentioned via https://github.com/brave/brave-core/pull/14350#issuecomment-1231063327 and ran through a full pass and ensured that the feature is working as expected as per https://github.com/brave/brave-core/pull/14886#issuecomment-1232366311. However, during 1.43.x verification, we'll just need to ensure that the crash was fixed as the full feature will be checked/verified via https://github.com/brave/brave-browser/issues/23062.

kjozwiak commented 2 years ago

Verification PASSED on Samsung S10+ running Android 12 using the following build(s):

Brave | 1.43.86 Chromium: 105.0.5195.68 (Official Build) (32-bit)
--- | ---
Revision | ad13e82529051bac6a0e65f455e6d7a1e5fd7938-refs/branch-heads/5195@{#903}
OS | Android 12; Build/SP1A.210812.016

Went through the STR/Cases outlined via https://github.com/brave/brave-browser/issues/25059#issue-1355086510 and ensured that Brave wasn't crashing when tapping on the omnibox.


Verification PASSED on Samsung S8 Ultra Tablet running Android 12 using the following build(s):

Brave | 1.43.86 Chromium: 105.0.5195.68 (Official Build) (32-bit)
--- | ---
Revision | ad13e82529051bac6a0e65f455e6d7a1e5fd7938-refs/branch-heads/5195@{#903}
OS | Android 12; Build/SPSA.220305.013

Went through the STR/Cases outlined via https://github.com/brave/brave-browser/issues/25059#issue-1355086510 and ensured that Brave wasn't crashing when tapping on the omnibox.