mapbox / mapbox-gl-native-ios

Interactive, thoroughly customizable maps for iOS powered by vector tiles and OpenGL
https://www.mapbox.com/mobile/
Other
210 stars 122 forks source link

Intermittent Crash CALayerInvalidGeometry on MGLMapView selectAnnotation #660

Open kostiag opened 2 years ago

kostiag commented 2 years ago

Environment

Observed behavior and steps to reproduce

this works most of the time and so far we could not figure out under what circumstances this results in a crash. Any theories on what could try to avoid this or what could be the cause would be appreciated.

programmatically create pin call self.mapContainer.mapView.selectAnnotation(pin

Expected behavior

call out consistently shows without crashes

Notes / preliminary analysis

Fatal Exception: CALayerInvalidGeometry CALayer position contains NaN: [nan 149]. Layer: <CALayer:0x28b3b4ec0; position = CGPoint (0 28.5); bounds = CGRect (0 0; 0 57); delegate = <MGLCompactCalloutView: 0x138259a80; frame = (0 0; 0 57); tintColor = UIExtendedSRGBColorSpace 0.602669 0.126759 0.283119 1; layer = <CALayer: 0x28b3b4ec0>>; sublayers = (<CALayer: 0x28b3b52c0>, <CALayer: 0x28b3b4f80>); allowsGroupOpacity = YES; backgroundColor = <CGColor 0x281084190> [<CGColorSpace 0x281783060> (kCGColorSpaceICCBased; kCGColorSpaceModelMonochrome; Generic Gray Gamma 2.2 Profile; extended range)] ( 0 0 )>

Fatal Exception: CALayerInvalidGeometry CALayer position contains NaN: [nan 16]. Layer: <CALayer:0x28176da60; position = CGPoint (0 28.5); bounds = CGRect (0 0; 0 57); delegate = <MGLCompactCalloutView: 0x10f94f800; frame = (0 0; 0 57); tintColor = UIExtendedSRGBColorSpace 0.602669 0.126759 0.283119 1; layer = <CALayer: 0x28176da60>>; sublayers = (<CALayer: 0x28176d140>, <CALayer: 0x28176cb40>); allowsGroupOpacity = YES; backgroundColor = <CGColor 0x283de1130> [<CGColorSpace 0x283ad2b80> (kCGColorSpaceICCBased; kCGColorSpaceModelMonochrome; Generic Gray Gamma 2.2 Profile; extended range)] ( 0 0 )>

Fatal Exception: CALayerInvalidGeometry CALayer position contains NaN: [nan 95.5]. Layer: <CALayer:0x287256d60; position = CGPoint (0 28.5); bounds = CGRect (0 0; 0 57); delegate = <MGLCompactCalloutView: 0x139394e60; frame = (0 0; 0 57); tintColor = UIExtendedSRGBColorSpace 0.602669 0.126759 0.283119 1; layer = <CALayer: 0x287256d60>>; sublayers = (<CALayer: 0x2872555a0>, <CALayer: 0x2872569e0>); allowsGroupOpacity = YES; backgroundColor = <CGColor 0x281122760> [<CGColorSpace 0x2816266a0> (kCGColorSpaceICCBased; kCGColorSpaceModelMonochrome; Generic Gray Gamma 2.2 Profile; extended range)] ( 0 0 )>

0 CoreFoundation __exceptionPreprocess 6 UIKitCore -[UIView(Geometry) setFrame:] 7 Mapbox SMCalloutView.m - Line 401 -[MGLSMCalloutView presentCalloutFromRect:inLayer:ofView:constrainedToRect:animated:] + 401 8 Mapbox SMCalloutView.m - Line 316 -[MGLSMCalloutView presentCalloutFromRect:inView:constrainedToRect:animated:] + 316 9 Mapbox MGLMapView.mm - Line 5541 -[MGLMapView selectAnnotation:moveIntoView:animateSelection:calloutPositioningRect:completionHandler:] + 5541 10 Mapbox MGLMapView.mm - Line 5360 -[MGLMapView selectAnnotation:moveIntoView:animateSelection:completionHandler:] + 5360

Additional links and references

ZiZasaurus commented 2 years ago

@kostiag thank you for reporting, transferring to our v6 repo.

datwelk commented 2 years ago

@ZiZasaurus is 'transferring issue to the v6 repo' the same as discarding it? There doesn't seem much activity there, despite Mapbox' promise to maintain the repo until April 2023.