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

Update nav-native to 9.2.1 #2412

Merged

Conversation

dersim-davaod
Copy link
Contributor

@dersim-davaod dersim-davaod commented Jun 22, 2020

This is a mirror of accidentally merged PR #2404.

The base branch was reset and a new PR (the current one) is created.

.circleci/config.yml Outdated Show resolved Hide resolved
@1ec5
Copy link
Contributor

1ec5 commented Jun 22, 2020

#2404 (comment)

We need to investigate this crash:

Test Case '-[MapboxCoreNavigationTests.NavigationServiceTests testNineLeggedRouteForOutOfBounds]' started.

Example(7724,0x117f4ddc0) malloc: Heap corruption detected, free list is damaged at 0x60000157f030

*** Incorrect guard value: 38475276463501360

Example(7724,0x117f4ddc0) malloc: *** set a breakpoint in malloc_error_break to debug

2020-06-17 12:06:23.327 xcodebuild[7211:56146]  IDETestOperationsObserverDebug: Writing diagnostic log for test session to:

/Users/distiller/Library/Developer/Xcode/DerivedData/MapboxNavigation-gtrukiuwvhbmctfcsthejciepfao/Logs/Test/Run-MapboxCoreNavigation-2020.06.17_12-02-10-+0000.xcresult/Staging/3_Test/Diagnostics/MapboxCoreNavigationTests-B2DAC58D-5CCA-43DB-8E85-CC7AD107D7BD/MapboxCoreNavigationTests-75AAA591-F207-4A8A-A5D9-612CA5B41C4E/Session-MapboxCoreNavigationTests-2020-06-17_120623-nArVQh.log

2020-06-17 12:06:23.327 xcodebuild[7211:31715] [MT] IDETestOperationsObserverDebug: (1807C777-2E15-4B3B-8DEC-5D9F1F670F80) Beginning test session MapboxCoreNavigationTests-1807C777-2E15-4B3B-8DEC-5D9F1F670F80 at 2020-06-17 12:06:23.327 with Xcode 11E146 on target <DVTiPhoneSimulator: 0x7fb76b8c0010> {

		SimDevice: iPhone 8 Plus (1D3A97B4-9101-4B3D-A749-18499F08082A, iOS 13.4, Booted)

} (13.4 (17E255))

2020-06-17 12:06:23.331 xcodebuild[7211:31715] [MT] IDETestOperationsObserverDebug: (1807C777-2E15-4B3B-8DEC-5D9F1F670F80) Finished requesting crash reports. Continuing with testing.

2020-06-17 12:06:25.241157+0000 Example[7742:70949] Launching with XCTest injected. Preparing to run tests.

2020-06-17 12:06:25.339864+0000 Example[7742:70949] Waiting to run tests until the app finishes launching.



Restarting after unexpected exit, crash, or test timeout in NavigationServiceTests/testNineLeggedRouteForOutOfBounds(); summary will include totals from previous launches.

Interesting that it only reproduces in the Xcode_10.2_iOS_10.3.1 image, or maybe it’s nondeterministic.

.circleci/config.yml Outdated Show resolved Hide resolved
@dersim-davaod dersim-davaod force-pushed the dersim-davaod-update-nav-native-to-9.2.1 branch 14 times, most recently from 456f625 to 3dccd30 Compare June 22, 2020 19:30
@1ec5
Copy link
Contributor

1ec5 commented Jun 22, 2020

Here’s the crash trace from NavigationServiceTests.testNineLeggedRouteForOutOfBounds():

#0	0x00007fff51becfea in nanov2_allocate_from_block.cold.1 ()
#1	0x00007fff51bd9f18 in nanov2_allocate_from_block ()
#2	0x00007fff51bd9113 in nanov2_allocate ()
#3	0x00007fff51bd9040 in nanov2_malloc ()
#4	0x00007fff51bdd2a3 in malloc_zone_malloc ()
#5	0x00007fff51bdda55 in malloc ()
#6	0x00007fff4f9f905a in operator new(unsigned long) ()
#7	0x000000010b73c328 in std::__1::__libcpp_allocate(unsigned long, unsigned long) [inlined] at /Applications/Xcode-11.3.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/new:239
#8	0x000000010b73c323 in std::__1::allocator<double>::allocate(unsigned long, void const*) [inlined] at /Applications/Xcode-11.3.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:1814
#9	0x000000010b73c323 in std::__1::allocator_traits<std::__1::allocator<double> >::allocate(std::__1::allocator<double>&, unsigned long) [inlined] at /Applications/Xcode-11.3.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:1547
#10	0x000000010b73c323 in std::__1::vector<double, std::__1::allocator<double> >::__vallocate(unsigned long) [inlined] at /Applications/Xcode-11.3.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:977
#11	0x000000010b73c31a in std::__1::vector<double, std::__1::allocator<double> >::vector(std::__1::vector<double, std::__1::allocator<double> > const&) [inlined] at /Applications/Xcode-11.3.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:1252
#12	0x000000010b73c2e6 in std::__1::vector<double, std::__1::allocator<double> >::vector(std::__1::vector<double, std::__1::allocator<double> > const&) [inlined] at /Applications/Xcode-11.3.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:1245
#13	0x000000010b73c2e6 in void std::__1::allocator<std::__1::vector<double, std::__1::allocator<double> > >::construct<std::__1::vector<double, std::__1::allocator<double> >, std::__1::vector<double, std::__1::allocator<double> > const&>(std::__1::vector<double, std::__1::allocator<double> >*, std::__1::vector<double, std::__1::allocator<double> > const&) [inlined] at /Applications/Xcode-11.3.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:1826
#14	0x000000010b73c2e6 in void std::__1::allocator_traits<std::__1::allocator<std::__1::vector<double, std::__1::allocator<double> > > >::__construct<std::__1::vector<double, std::__1::allocator<double> >, std::__1::vector<double, std::__1::allocator<double> > const&>(std::__1::integral_constant<bool, true>, std::__1::allocator<std::__1::vector<double, std::__1::allocator<double> > >&, std::__1::vector<double, std::__1::allocator<double> >*, std::__1::vector<double, std::__1::allocator<double> > const&) [inlined] at /Applications/Xcode-11.3.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:1718
#15	0x000000010b73c2e6 in void std::__1::allocator_traits<std::__1::allocator<std::__1::vector<double, std::__1::allocator<double> > > >::construct<std::__1::vector<double, std::__1::allocator<double> >, std::__1::vector<double, std::__1::allocator<double> > const&>(std::__1::allocator<std::__1::vector<double, std::__1::allocator<double> > >&, std::__1::vector<double, std::__1::allocator<double> >*, std::__1::vector<double, std::__1::allocator<double> > const&) [inlined] at /Applications/Xcode-11.3.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:1561
#16	0x000000010b73c2e6 in std::__1::vector<std::__1::vector<double, std::__1::allocator<double> >, std::__1::allocator<std::__1::vector<double, std::__1::allocator<double> > > >::__construct_at_end(unsigned long, std::__1::vector<double, std::__1::allocator<double> > const&) [inlined] at /Applications/Xcode-11.3.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:1052
#17	0x000000010b73c2e6 in std::__1::vector<std::__1::vector<double, std::__1::allocator<double> >, std::__1::allocator<std::__1::vector<double, std::__1::allocator<double> > > >::vector(unsigned long, std::__1::vector<double, std::__1::allocator<double> > const&) at /Applications/Xcode-11.3.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:1150
#18	0x000000010b73a7b1 in std::__1::vector<std::__1::vector<double, std::__1::allocator<double> >, std::__1::allocator<std::__1::vector<double, std::__1::allocator<double> > > >::vector(unsigned long, std::__1::vector<double, std::__1::allocator<double> > const&) [inlined] at /Applications/Xcode-11.3.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:1143
#19	0x000000010b73a7a6 in mblc::Matrix::Matrix(unsigned long, unsigned long) at /Users/distiller/project/thirdparty/mapbox-location-native/src/mblc/kalman/matrix.cpp:10
#20	0x000000010b73be4a in mblc::Matrix::Matrix(unsigned long, unsigned long) [inlined] at /Users/distiller/project/thirdparty/mapbox-location-native/src/mblc/kalman/matrix.cpp:10
#21	0x000000010b73be45 in mblc::Matrix::operator-(mblc::Matrix const&) const at /Users/distiller/project/thirdparty/mapbox-location-native/src/mblc/kalman/matrix.cpp:214
#22	0x000000010b7383c8 in mblc::ExtendedKalmanFilter::Correct(mblc::Matrix const&) at /Users/distiller/project/thirdparty/mapbox-location-native/src/mblc/kalman/extended_kalman_filter.cpp:58
#23	0x000000010b7398ee in mblc::LocationEKF::ImplUpdate(mapbox::location::FixLocation const&) at /Users/distiller/project/thirdparty/mapbox-location-native/src/mblc/kalman/location_ekf.cpp:165
#24	0x000000010b738ea0 in mblc::LocationEKF::Update(mapbox::location::FixLocation const&) at /Users/distiller/project/thirdparty/mapbox-location-native/src/mblc/kalman/location_ekf.cpp:72
#25	0x000000010b73d1f5 in mblc::location_processor::Kalman::update(mapbox::location::FixLocation const&) at /Users/distiller/project/thirdparty/mapbox-location-native/src/mblc/location_processor/kalman.cpp:13
#26	0x000000010b73d0eb in mblc::location_processor::FirstOf::update(mapbox::location::FixLocation const&) at /Users/distiller/project/thirdparty/mapbox-location-native/src/mblc/location_processor/first_of.cpp:14
#27	0x000000010b7518e1 in mblc::MapboxLocation::update(mapbox::location::FixLocation const&) at /Users/distiller/project/thirdparty/mapbox-location-native/src/mblc/mapbox_location.cpp:60
#28	0x000000010b63fdb1 in navigator::NavigatorImpl::updateLocation(mapbox::location::FixLocation const&) at /Users/distiller/project/src/navigator_impl_location.cpp:16
#29	0x000000010b5f182a in -[MBNavigator updateLocationForFixLocation:] at /Users/distiller/project/build/ios/x86_64/MBNavigator+Private.mm:121
#30	0x000000010d46988c in closure #1 in RouteController.locationManager(_:didUpdateLocations:) at /path/to/mapbox-navigation-ios/MapboxCoreNavigation/RouteController.swift:199
#31	0x000000010d4698e2 in thunk for @callee_guaranteed (@guaranteed CLLocation) -> (@error @owned Error) ()
#32	0x000000010d469934 in partial apply for thunk for @callee_guaranteed (@guaranteed CLLocation) -> (@error @owned Error) ()
#33	0x000000010d7349dd in Sequence.forEach(_:) ()
#34	0x000000010d4690ff in RouteController.locationManager(_:didUpdateLocations:) at /path/to/mapbox-navigation-ios/MapboxCoreNavigation/RouteController.swift:199
#35	0x000000010d46a6cb in @objc RouteController.locationManager(_:didUpdateLocations:) ()
#36	0x000000010d47e94e in partial apply ()
#37	0x000000010d4421dc in thunk for @escaping @callee_guaranteed (@unowned CLLocationManager, @unowned NSArray) -> () ()
#38	0x000000010d47c297 in MapboxNavigationService.locationManager(_:didUpdateLocations:) at /path/to/mapbox-navigation-ios/MapboxCoreNavigation/NavigationService.swift:407
#39	0x000000010d47c60b in @objc MapboxNavigationService.locationManager(_:didUpdateLocations:) ()
#40	0x000000010e502236 in NavigationServiceTests.testNineLeggedRouteForOutOfBounds() at /path/to/mapbox-navigation-ios/MapboxCoreNavigationTests/NavigationServiceTests.swift:508

@1ec5
Copy link
Contributor

1ec5 commented Jun 22, 2020

NavigationServiceTests.testNineLeggedRouteForOutOfBounds() was introduced in #2138 to test what used to be a crash when some route progress indices got out of sync in Core Navigation. It sped up the simulation 4×, which runs into a limitation of MapboxNavigationNative that it doesn’t seem to cope well with being sped up that much right out of the gate. I’ve slowed it down, so hopefully that keeps the crash at bay for now.

@1ec5
Copy link
Contributor

1ec5 commented Jun 23, 2020

The 9-legged-route test generates a series of location updates based on quite a complex route that doubles back over itself, and the Polyline-encoded geometry seems to have some encoding issues. Compare the geometry decoded as Polyline with precision 6 to the raw waypoint coordinates:

Screenshot-2020-6-22 geojson io
Screenshot-2020-6-22 geojson io(1)

@1ec5
Copy link
Contributor

1ec5 commented Jun 23, 2020

I’m taking the unusual step of removing the NavigationServiceTests.testNineLeggedRouteForOutOfBounds() test entirely due to the problems with the test fixture. After trying in vain to reproduce the crash more organically, I’m coming to the conclusion that it’s exercising quite an edge case that isn’t worth our time to debug at this point. If we need to test the fix for #2138 in the future, we should do so with a reduced test case that’s easier to debug and is less likely to get tripped up by unrelated changes.

@1ec5 1ec5 force-pushed the release-v1.0-pre-registry branch from 026f599 to 986d984 Compare June 23, 2020 02:02
@1ec5 1ec5 force-pushed the dersim-davaod-update-nav-native-to-9.2.1 branch from 8e99971 to 02a8546 Compare June 23, 2020 02:19
@1ec5 1ec5 marked this pull request as ready for review June 23, 2020 02:20
@1ec5 1ec5 self-assigned this Jun 23, 2020
@1ec5 1ec5 added this to the v1.0.0 milestone Jun 23, 2020
@1ec5 1ec5 merged commit 489a12d into release-v1.0-pre-registry Jun 23, 2020
@1ec5 1ec5 deleted the dersim-davaod-update-nav-native-to-9.2.1 branch June 23, 2020 02:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform parity Required to keep on par with Android. topic: directions topic: location
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants