Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Launching the app via the Shortcuts Widget Search button may crash #41457

Closed
3 of 5 tasks
kylehickinson opened this issue Oct 7, 2024 · 2 comments · Fixed by brave/brave-core#25862
Closed
3 of 5 tasks

Comments

@kylehickinson
Copy link
Collaborator

Description

There's a possible race condition that can happen when launching the app with the shortcuts widget, specifically the "Search" button which highlights the URL bar immediately.

Steps to reproduce

  1. Add a Shorcuts widget to the home screen and ensure the app is fully closed (force kill from app switcher)
  2. Tap the "Search or type URL" shortcut link in the widget

Actual result

In some situations, the app will crash

Expected result

No crash

Reproduces how often

Intermittent issue

Brave version

1.69+

Device/iOS version

any

Affected browser versions

  • latest AppStore
  • latest TestFlight
  • previous TestFlight

Reproducibility

  • with Brave Shields disabled
  • in the latest version of mobile Safari

Miscellaneous information

Crash Log
Incident Identifier: 23CF8FE5-5852-46B4-8E7F-1B9843D6AB63
Distributor ID:      com.apple.AppStore
Hardware Model:      iPhone16,1
Process:             Client [2692]
Path:                /private/var/containers/Bundle/Application/4C8C0559-9EA5-4085-B438-CB20AF0D1E9D/Client.app/Client
Identifier:          com.brave.ios.browser
Version:             1.69.2 (172)
AppStoreTools:       16A242b
AppVariant:          1:iPhone16,1:18
Code Type:           ARM-64 (Native)
Role:                Foreground
Parent Process:      launchd [1]
Coalition:           com.brave.ios.browser [1699]

Date/Time:           2024-10-07 12:17:57.9627 +0200
Launch Time:         2024-10-07 10:14:53.2044 +0200
OS Version:          iPhone OS 18.1 (22B5054e)
Release Type:        Beta
Baseband Version:    2.20.02
Report Version:      104

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x00000001026176a4
Termination Reason: SIGNAL 5 Trace/BPT trap: 5
Terminating Process: exc handler [2692]

Triggered by Thread:  0



Thread 0 Crashed:
0   Client                        	0x00000001026176a4 Swift runtime failure: Index out of range + 0 (<compiler-generated>:0)
1   Client                        	0x00000001026176a4 specialized Array._checkSubscript(_:wasNativeTypeChecked:) + 0 (<compiler-generated>:0)
2   Client                        	0x00000001026176a4 specialized Array.subscript.getter + 0 (<compiler-generated>:0)
3   Client                        	0x00000001026176a4 SearchEngines.defaultEngine(forType:) + 492
4   Client                        	0x000000010242b298 SearchEngines.queryForSearchURL(_:forType:) + 8 (SearchEngines.swift:254)
5   Client                        	0x000000010242b298 BrowserViewController.topToolbarDisplayTextForURL(_:) + 1036 (BVC+ToolbarDelegate.swift:199)
6   Client                        	0x00000001026da4ec protocol witness for TopToolbarDelegate.topToolbarDisplayTextForURL(_:) in conformance BrowserViewController + 12 (<compiler-generated>:0)
7   Client                        	0x00000001026da4ec specialized TopToolbarView.tabLocationViewDidTapLocation(_:) + 308 (TopToolbarView.swift:848)
8   Client                        	0x00000001024ed0fc TopToolbarView.tabLocationViewDidTapLocation(_:) + 8 (BrowserViewController.swift:3229)
9   Client                        	0x00000001024ed0fc BrowserViewController.focusURLBar() + 8 (<compiler-generated>:0)
10  Client                        	0x00000001024ed0fc specialized static NavigationPath.handleWidgetShortcut(_:with:) + 2784
11  Client                        	0x00000001024ed4ac static NavigationPath.handleWidgetShortcut(_:with:) + 8 (<compiler-generated>:0)
12  Client                        	0x00000001024ed4ac specialized static NavigationPath.handle(nav:with:) + 556 (NavigationRouter.swift:82)
13  Client                        	0x00000001024a6b30 thunk for @escaping @callee_guaranteed () -> () + 4 (<compiler-generated>:0)
14  Client                        	0x00000001024a6b30 partial apply for thunk for @escaping @callee_guaranteed () -> () + 20
15  Client                        	0x00000001024a7d8c thunk for @escaping @callee_guaranteed () -> (@out ()) + 4 (<compiler-generated>:0)
16  Client                        	0x00000001024a7d8c partial apply for thunk for @escaping @callee_guaranteed () -> (@out ()) + 20
17  Client                        	0x00000001024a7dac closure #1 in BrowserViewController.setupTabs() + 4 (BrowserViewController.swift:1187)
18  Client                        	0x00000001024a7dac partial apply for closure #1 in BrowserViewController.setupTabs() + 20 (<compiler-generated>:0)
19  Client                        	0x00000001023b3888 thunk for @escaping @callee_guaranteed () -> () + 28 (<compiler-generated>:0)
20  libdispatch.dylib             	0x00000001a3463370 _dispatch_call_block_and_release + 32 (init.c:1549)
21  libdispatch.dylib             	0x00000001a34650d0 _dispatch_client_callout + 20 (object.m:576)
22  libdispatch.dylib             	0x00000001a34739e0 _dispatch_main_queue_drain + 980 (queue.c:8093)
23  libdispatch.dylib             	0x00000001a34735fc _dispatch_main_queue_callback_4CF + 44 (queue.c:8253)
24  CoreFoundation                	0x000000019b771204 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16 (CFRunLoop.c:1793)
25  CoreFoundation                	0x000000019b76e440 __CFRunLoopRun + 1996 (CFRunLoop.c:3163)
26  CoreFoundation                	0x000000019b76d830 CFRunLoopRunSpecific + 588 (CFRunLoop.c:3434)
27  GraphicsServices              	0x00000001e7a851c4 GSEventRunModal + 164 (GSEvent.c:2196)
28  UIKitCore                     	0x000000019e2db9a4 -[UIApplication _run] + 816 (UIApplication.m:3835)
29  UIKitCore                     	0x000000019e38a168 UIApplicationMain + 340 (UIApplication.m:5487)
30  UIKitCore                     	0x000000019e6c2478 UIApplicationMain(_:_:_:_:) + 104 (UIKit.swift:565)
31  Client                        	0x000000010238659c specialized static UIApplicationDelegate.main() + 28 (<compiler-generated>:38)
32  Client                        	0x000000010238659c static AppDelegate.$main() + 28 (AppDelegate.swift:0)
33  Client                        	0x000000010238659c main + 120
34  dyld                          	0x00000001c149dec8 0x1c146a000 + 212680

@kjozwiak
Copy link
Member

kjozwiak commented Oct 8, 2024

The above requires 1.70.126 or higher for 1.70.x verification 👍

@hffvld hffvld added the QA/In-Progress Indicates that QA is currently in progress for that particular issue label Oct 9, 2024
@hffvld
Copy link
Contributor

hffvld commented Oct 9, 2024

Verified on iPhone 14 using version(s):

Device/OS: iPhone 14 / iOS 17.7
Brave build: 1.70 (126)
BraveCore: 1.70.126 (129.0.6668.100)

STEPS:

  1. Follow the STR/TP from Launching the app via the Shortcuts Widget Search button may crash #41457 (comment) and [iOS] Fix potential crash when launching the app from a shortcuts widget brave-core#25862 (comment)
  2. Verify

ACTUAL RESULTS:

  • Verified that Brave is not crashing when launching it from Shortcats Widget

2024-10-09_15-50-38.mp4

@hffvld hffvld added QA Pass - iPhone and removed QA/In-Progress Indicates that QA is currently in progress for that particular issue labels Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants