You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Infinite loop zooming in beyond z23 — -[MGLScaleBar labels] #9359
As soon as you zoom in beyond z23, iosapp hangs with this stack:
#0 0x000000011401cc58 in _Block_object_dispose ()
#1 0x00007fff51d09800 in 0x7fff51d09800 ()
#2 0x0000000111cc1dfb in -[_UITintColorVisitor _visitView:] ()
#3 0x0000000111cc24ba in _UIViewVisitorEntertainVisitors ()
#4 0x0000000111cc1655 in _UIViewVisitorRecursivelyEntertainDescendingVisitors ()
#5 0x0000000111cc1706 in _UIViewVisitorRecursivelyEntertainDescendingVisitors ()
#6 0x0000000111cc0ff8 in _UIViewVisitorEntertainDescendingTrackingVisitors ()
#7 0x0000000111957c0a in __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke ()
#8 0x0000000111957a7d in -[UIView(Hierarchy) _postMovedFromSuperview:] ()
#9 0x0000000111967a0a in -[UIView(Internal) _addSubview:positioned:relativeTo:] ()
#10 0x0000000111955cf8 in -[UIView(Hierarchy) addSubview:] ()
#11 0x000000010e275a86 in ::-[MGLScaleBar labels]() at /Users/mxn/hub/mapbox-gl-native/platform/ios/src/MGLScaleBar.mm:295
#12 0x000000010e275cd5 in ::-[MGLScaleBar updateLabels]() at /Users/mxn/hub/mapbox-gl-native/platform/ios/src/MGLScaleBar.mm:318
#13 0x000000010e275c55 in ::-[MGLScaleBar layoutSubviews]() at /Users/mxn/hub/mapbox-gl-native/platform/ios/src/MGLScaleBar.mm:312
#14 0x000000011196b55b in -[UIView(CALayerDelegate) layoutSublayersOfLayer:] ()
#15 0x0000000113bef904 in -[CALayer layoutSublayers] ()
At this frame, i keeps incrementing and labels keeps getting longer until the device runs out of memory. This occurs because:
I reproduced this with the system locale set to one that uses U.S. units. iosapp was running on an iPhone 7 simulator, both in landscape and in portrait orientation.
-[MGLScaleBar maximumWidth] is based on the map view’s width, so it’s quite possible for the crash to occur at lower zoom levels if the developer gives the map view a different aspect ratio.
Activity
1ec5 commentedon Jun 23, 2017
-[MGLScaleBar maximumWidth]is based on the map view’s width, so it’s quite possible for the crash to occur at lower zoom levels if the developer gives the map view a different aspect ratio.1ec5 commentedon Jun 23, 2017
This issue would’ve been caught by the static analyzer:
1ec5 commentedon Jun 24, 2017
Fixed in #9360 on the release-ios-v3.6.0-android-v5.1.0 branch.