mapbox / mapbox-maps-ios

Interactive, thoroughly customizable maps for iOS powered by vector tiles and Metal
https://www.mapbox.com/mapbox-mobile-sdk
Other
475 stars 153 forks source link

App crashes initializing map with MapView(frame: .infinite) #2250

Open teradyl opened 6 days ago

teradyl commented 6 days ago

Environment

Observed behavior and steps to reproduce

running MapView(frame: .infinite) crashes the app.

Expected behavior

I can create a map with infinite frame, or if not it doesn't crash!

Notes / preliminary analysis

I didn't have an iOS 18 device to test on yet, but my iOS 17.5.1 device did NOT crash on this. Here is the stacktrace of the crash on the simulator, however:

*** Terminating app due to uncaught exception 'failed to resize: size is empty', reason: 'failed to resize: size is empty'
*** First throw call stack:
(
    0   CoreFoundation                      0x00007ff80049928d __exceptionPreprocess + 242
    1   libobjc.A.dylib                     0x00007ff800063894 objc_exception_throw + 48
    2   CoreFoundation                      0x00007ff80049916b -[NSException initWithCoder:] + 0
    3   MapboxCoreMaps                      0x0000000106d193c3 -[MBMMap initWithClient:mapOptions:] + 1411
    4   MapboxMaps                          0x00000001082c416a $sSo6MBMMapC6client10mapOptionsABSo0A6Client_p_So0aD0CtcfcTO + 42
    5   MapboxMaps                          0x00000001082bd24a $sSo6MBMMapC6client10mapOptionsABSo0A6Client_p_So0aD0CtcfC + 58
    6   MapboxMaps                          0x00000001082bd1a2 $s10MapboxMaps7MapViewC04makeaC0014_70E33D7C53C03G17B318C1EBAA9D6836ELL08resolvedC11InitOptionsAA0aC0CAA0coP0C_tF + 290
    7   MapboxMaps                          0x00000001082bc8e5 $s10MapboxMaps7MapViewC10commonInit014_70E33D7C53C03H17B318C1EBAA9D6836ELL03mapF7Options18overridingStyleURIyAA0cfP0C_10Foundation3URLVSgtF + 517
    8   MapboxMaps                          0x00000001082b8d8f $s10MapboxMaps7MapViewC5frame14mapInitOptionsACSo6CGRectV_AA0cgH0Ctcfc + 3279
    9   MapboxMaps                          0x00000001082b80b2 $s10MapboxMaps7MapViewC5frame14mapInitOptionsACSo6CGRectV_AA0cgH0CtcfC + 82
    10 -15 my app code 
    16  UIKitCore                           0x00007ff8054f2dd1 -[UIGestureRecognizerTarget _sendActionWithGestureRecognizer:] + 71
    17  UIKitCore                           0x00007ff8054fc7bf _UIGestureRecognizerSendTargetActions + 100
    18  UIKitCore                           0x00007ff8054f9519 _UIGestureRecognizerSendActions + 303
    19  UIKitCore                           0x00007ff8054f88c6 -[UIGestureRecognizer _updateGestureForActiveEvents] + 685
    20  UIKitCore                           0x00007ff8054e61e1 _UIGestureEnvironmentUpdate + 3935
    21  UIKitCore                           0x00007ff8054e4e1d -[UIGestureEnvironment _updateForEvent:window:] + 892
    22  UIKitCore                           0x00007ff805bbbc3e -[UIWindow sendEvent:] + 5262
    23  UIKitCore                           0x00007ff805b90e6c -[UIApplication sendEvent:] + 772
    24  UIKit                               0x00007ff8450e1fdf -[UIApplicationAccessibility sendEvent:] + 85
    25  UIKitCore                           0x00007ff805c3db99 __dispatchPreprocessedEventFromEventQueue + 8406
    26  UIKitCore                           0x00007ff805c40455 __processEventQueue + 8414
    27  UIKitCore                           0x00007ff805c3680f __eventQueueSourceCallback + 74
    28  CoreFoundation                      0x00007ff8003f5d0f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    29  CoreFoundation                      0x00007ff8003f5c51 __CFRunLoopDoSource0 + 157
    30  CoreFoundation                      0x00007ff8003f544e __CFRunLoopDoSources0 + 215
    31  CoreFoundation                      0x00007ff8003efb83 __CFRunLoopRun + 919
    32  CoreFoundation                      0x00007ff8003ef409 CFRunLoopRunSpecific + 557
    33  GraphicsServices                    0x00007ff80fcdd187 GSEventRunModal + 137
    34  UIKitCore                           0x00007ff805b703a2 -[UIApplication _run] + 972
    35  UIKitCore                           0x00007ff805b74e10 UIApplicationMain + 123
    36  UIKitCore                           0x00007ff804c1fe03 __swift_destroy_boxed_opaque_existential_1Tm + 12707
)
libc++abi: terminating due to uncaught exception of type NSException
pjleonard37 commented 3 days ago

Thanks for reporting this @teradyl. I've been able to replicate this issue on my side. I'm taking this back for discussion with the broader team.

pjleonard37 commented 3 days ago

Hi @teradyl --

Can you share a bit more about your use case here? Why are you setting an .infinite frame?