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

Crash previewing a step from the step table — RouteLegProgress.init(leg:stepIndex:spokenInstructionIndex:) #3062

Closed
dmiluski opened this issue Jun 8, 2021 · 6 comments · Fixed by #3416
Assignees
Labels
bug Something isn’t working
Milestone

Comments

@dmiluski
Copy link

dmiluski commented Jun 8, 2021

I'm running into a crasher while running on Nav SDK betas. We should be able to update SDKs to latest in our next sprint, but wanted to share in case this helped find an issue in the SDKs

Mapbox Navigation SDK version:

-v2 beta 8

Steps to reproduce

  1. Begin Navigation
  2. Tap top banner to show steps of the directions
  3. Scroll to the bottom, tap arrive at destination (sometime crash)

Expected behavior

Not crash

Actual behavior

Crash

stepCrash

Crashed: com.apple.main-thread
0  Straightaway                   0x102e7dc08 specialized RouteLegProgress.init(leg:stepIndex:spokenInstructionIndex:) + 4367932424 (RouteLegProgress.swift:4367932424)
1  Straightaway                   0x102e7c5f8 RouteLegProgress.init(leg:stepIndex:spokenInstructionIndex:) + 4367926776 (<compiler-generated>:4367926776)
2  Straightaway                   0x102d58d44 specialized NavigationViewController.topBanner(_:didSelect:stepIndex:cell:) + 960 (NavigationViewController.swift:960)
3  Straightaway                   0x102d8dbb8 protocol witness for StepsViewControllerDelegate.stepsViewController(_:didSelect:stepIndex:cell:) in conformance TopBannerViewController + 4366949304 (<compiler-generated>:4366949304)
4  Straightaway                   0x102d79af8 StepsViewController.tableView(_:didSelectRowAt:) + 206 (StepsViewController.swift:206)
5  Straightaway                   0x102d79c14 @objc StepsViewController.tableView(_:didSelectRowAt:) + 4366867476 (<compiler-generated>:4366867476)
6  UIKitCore                      0x184ea3f3c -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:isCellMultiSelect:] + 1104
7  UIKitCore                      0x184ea3ad4 -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] + 108
8  UIKitCore                      0x184ea42a0 -[UITableView _userSelectRowAtPendingSelectionIndexPath:] + 268
9  UIKitCore                      0x185153fb8 -[_UIAfterCACommitBlock run] + 64
10 UIKitCore                      0x184cb9a68 _runAfterCACommitDeferredBlocks + 296
11 UIKitCore                      0x184ca8f98 _cleanUpAfterCAFlushAndRunDeferredBlocks + 200
12 UIKitCore                      0x184cda568 _afterCACommitHandler + 76
13 CoreFoundation                 0x1823c087c __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
14 CoreFoundation                 0x1823baf50 __CFRunLoopDoObservers + 604
15 CoreFoundation                 0x1823bb498 __CFRunLoopRun + 960
16 CoreFoundation                 0x1823baba0 CFRunLoopRunSpecific + 572
17 GraphicsServices               0x1990f8598 GSEventRunModal + 160
18 UIKitCore                      0x184caa3d8 -[UIApplication _run] + 1052
19 UIKitCore                      0x184caf958 UIApplicationMain + 164
20 Straightaway                   0x102a12884 main + 12 (CheckboxToggleStyle.swift:12)
21 libdyld.dylib                  0x182099568 start + 4
@1ec5
Copy link
Contributor

1ec5 commented Jun 8, 2021

Is there anything that would cause an out-of-bounds step index or spoken instruction index to be passed into the RouteLegProgress initializer?

@dmiluski
Copy link
Author

dmiluski commented Jun 9, 2021

Good point, will investigate locally.

@dmiluski dmiluski closed this as completed Jun 9, 2021
@dmiluski dmiluski reopened this Jun 10, 2021
@dmiluski
Copy link
Author

Running on device, we have the ability to begin a full navigation, or jump to individual waypoints to begin navigation at that point. Unfortunately, I have yet to reproduce locally with my experiments, I'm wondering if perhaps there is a mismatch between spoken.

Reading the backtrace here, I attempted viewing the steps of the navigation (by tapping the top bar), then by scrolling down to the bottom.

@1ec5 1ec5 changed the title Crash: RouteLegProgress(init:spokenInstructionIndex:) Crash previewing a step from the step table — RouteLegProgress.init(leg:stepIndex:spokenInstructionIndex:) Jun 10, 2021
@dmiluski
Copy link
Author

Uploading Xcode Trace
cc @ShanMa1991

Screen Shot 2021-09-30 at 9 21 06 AM

@dmiluski
Copy link
Author

Thread 0 name:
Thread 0 Crashed:
0   Straightaway                  	0x0000000103374070 Swift runtime failure: precondition failure + 0 (RouteLegProgress.swift:0)
1   Straightaway                  	0x0000000103374070 specialized Range.contains(_:) + 4 (RouteLegProgress.swift:145)
2   Straightaway                  	0x0000000103374070 specialized RouteLegProgress.init(leg:stepIndex:spokenInstructionIndex:) + 304 (RouteLegProgress.swift:145)
3   Straightaway                  	0x0000000103372ccc RouteLegProgress.init(leg:stepIndex:spokenInstructionIndex:) + 20 (<compiler-generated>:0)
4   Straightaway                  	0x000000010323ccd0 RouteLegProgress.__allocating_init(leg:stepIndex:spokenInstructionIndex:) + 44 (<compiler-generated>:0)
5   Straightaway                  	0x000000010323ccd0 specialized NavigationViewController.topBanner(_:didSelect:stepIndex:cell:) + 272
6   Straightaway                  	0x000000010323ccd0 0x102e10000 + 4377808 (NavigationViewController.swift:1106)
7   Straightaway                  	0x0000000103275da4 TopBannerViewController.stepsViewController(_:didSelect:stepIndex:cell:) + 72 (TopBannerViewController.swift:450)
8   Straightaway                  	0x0000000103275da4 protocol witness for StepsViewControllerDelegate.stepsViewController(_:didSelect:stepIndex:cell:) in conformance TopBannerViewController + 104 (<compiler-generated>:449)
9   Straightaway                  	0x0000000103261650 StepsViewController.tableView(_:didSelectRowAt:) + 508 (StepsViewController.swift:206)
10  Straightaway                  	0x000000010326176c @objc StepsViewController.tableView(_:didSelectRowAt:) + 140 (<compiler-generated>:0)
11  UIKitCore                     	0x000000019ff463a8 -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:isCellMultiSelect:] + 1072 (UITableView.m:8463)
12  UIKitCore                     	0x000000019ff45f50 -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] + 112 (UITableView.m:8377)
13  UIKitCore                     	0x000000019ff46710 -[UITableView _userSelectRowAtPendingSelectionIndexPath:] + 272 (UITableView.m:8502)
14  UIKitCore                     	0x00000001a0210e70 -[_UIAfterCACommitBlock run] + 72 (_UIAfterCACommitQueue.m:122)
15  UIKitCore                     	0x000000019fd4389c _runAfterCACommitDeferredBlocks + 300 (UIApplication.m:2936)
16  UIKitCore                     	0x000000019fd32214 _cleanUpAfterCAFlushAndRunDeferredBlocks + 204 (UIApplication.m:2914)
17  UIKitCore                     	0x000000019fd660e8 _afterCACommitHandler + 80 (UIApplication.m:2970)
18  CoreFoundation                	0x000000019d2bbc74 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 36 (CFRunLoop.c:1799)
19  CoreFoundation                	0x000000019d2b5d98 __CFRunLoopDoObservers + 572 (CFRunLoop.c:1912)
20  CoreFoundation                	0x000000019d2b6344 __CFRunLoopRun + 1052 (CFRunLoop.c:2953)
21  CoreFoundation                	0x000000019d2b59f4 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3242)
22  GraphicsServices              	0x00000001b4986734 GSEventRunModal + 164 (GSEvent.c:2259)
23  UIKitCore                     	0x000000019fd3375c -[UIApplication _run] + 1072 (UIApplication.m:3269)
24  UIKitCore                     	0x000000019fd38fcc UIApplicationMain + 168 (UIApplication.m:4740)
25  Straightaway                  	0x0000000102e196b8 main + 68 (AppDelegate.swift:12)
26  libdyld.dylib                 	0x000000019cf71cf8 start + 4

@truburt truburt added the bug Something isn’t working label Oct 4, 2021
@ShanMa1991
Copy link
Contributor

@dmiluski
It's fixed in #3416 and will be included in this release, there won't be more preview related crashes. And the root cause would be later fixed by the #3432.

@ShanMa1991 ShanMa1991 self-assigned this Oct 4, 2021
@ShanMa1991 ShanMa1991 added this to the v2.0 milestone Oct 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn’t working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants