maplibre / flutter-maplibre-gl

Customizable, performant and vendor-free vector and raster maps, flutter wrapper for maplibre-native and maplibre-gl-js (fork of flutter-mapbox-gl/maps)
https://pub.dev/packages/maplibre_gl
Other
186 stars 106 forks source link

Crash on iOS 17.4 simulator #388

Closed Etheonor closed 1 month ago

Etheonor commented 3 months ago

Hello,

I have an issue with flutter-maplibre. It was working fine on the simulator and today I was asked to update my iOS version to 17.4 I now have a crash each time I try to display the map. It still works fine on Android.

Here is the crash log:

-------------------------------------
Translated Report (Full Report Below)
-------------------------------------

Incident Identifier: C118811A-CF80-4602-AFA7-67D9EAC184EB
CrashReporter Key:   B619175D-A171-DE4E-FA9B-5F4810E6662C
Hardware Model:      MacBookAir10,1
Process:             Runner [90933]
Path:                /Users/USER/Library/Developer/CoreSimulator/Devices/6F02F500-716B-471C-A79F-5C9CE8D4031B/data/Containers/Bundle/Application/61D89F07-88DA-47F5-880C-D559A2680876/Runner.app/Runner
Identifier:          com.example.myApp
Version:             0.1.0 (0.1.0)
Code Type:           ARM-64 (Native)
Role:                Foreground
Parent Process:      launchd_sim [89921]
Coalition:           com.apple.CoreSimulator.SimDevice.6F02F500-716B-471C-A79F-5C9CE8D4031B [35564]
Responsible Process: SimulatorTrampoline [54367]

Date/Time:           2024-03-06 16:11:21.9548 +0100
Launch Time:         2024-03-06 16:10:59.3279 +0100
OS Version:          macOS 14.2.1 (23C71)
Release Type:        User
Report Version:      104

Exception Type:  EXC_BAD_ACCESS (SIGBUS)
Exception Subtype: KERN_PROTECTION_FAILURE at 0x0000000118b6c000
Exception Codes: 0x0000000000000002, 0x0000000118b6c000
VM Region Info: 0x118b6c000 is in 0x118b6c000-0x118b7c000;  bytes after start: 0  bytes before end: 65535
      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      MALLOC_LARGE                118b54000-118b6c000    [   96K] rw-/rwx SM=PRV  
--->  VM_ALLOCATE                 118b6c000-118b7c000    [   64K] rwx/rwx SM=PRV  
      GAP OF 0x4000 BYTES
      VM_ALLOCATE                 118b80000-118b98000    [   96K] rw-/rwx SM=PRV  
Termination Reason: SIGNAL 10 Bus error: 10
Terminating Process: exc handler [90933]

Triggered by Thread:  30

Thread 0::  Dispatch queue: com.apple.main-thread
0   libsystem_platform.dylib               0x105fdf5a4 _platform_memset + 180
1   libGLProgrammability.dylib             0x1a5e56960 glvmInterpretFPTransformFour + 432
2   GLRendererFloat                        0x1c9eb1430 gldLLVMFPTransform + 484
3   GLRendererFloat                        0x1c9ec07ec gldLLVMVecPolyRender + 19348
4   GLRendererFloat                        0x1c9eae338 gldRenderFillPolygonPtr + 92
5   GLEngine                               0x1a5dd71e4 gleLLVMVecPrimMultiRender + 6204
6   GLEngine                               0x1a5d76f64 gleDrawArraysOrElements_ExecCore + 1012
7   GLEngine                               0x1a5d79070 glDrawElements_IMM_ES2Exec + 576
8   Mapbox                                 0x1066f0ac0 mbgl::gl::Context::draw(mbgl::gfx::DrawMode const&, unsigned long, unsigned long) + 136
9   Mapbox                                 0x10672bf28 mbgl::gl::Program<mbgl::ClippingMaskProgram>::draw(mbgl::gfx::Context&, mbgl::gfx::RenderPass&, mbgl::gfx::DrawMode const&, mbgl::gfx::DepthMode const&, mbgl::gfx::StencilMode const&, mbgl::gfx::ColorMode const&, mbgl::gfx::CullFaceMode const&, mbgl::gfx::UniformValues<mbgl::TypeList<mbgl::uniforms::matrix>> const&, mbgl::gfx::DrawScope&, mbgl::gfx::AttributeBindings<mbgl::TypeList<mbgl::attributes::pos>> const&, mbgl::gfx::TextureBindings<mbgl::TypeList<>> const&, mbgl::gfx::IndexBuffer const&, unsigned long, unsigned long) + 768
10  Mapbox                                 0x10679e790 void mbgl::Program<mbgl::ClippingMaskProgram, (mbgl::gfx::PrimitiveType)2, mbgl::TypeList<mbgl::attributes::pos>, mbgl::TypeList<mbgl::uniforms::matrix>, mbgl::TypeList<>, mbgl::style::Properties<>>::draw<mbgl::gfx::Triangles>(mbgl::gfx::Context&, mbgl::gfx::RenderPass&, mbgl::gfx::Triangles const&, mbgl::gfx::DepthMode const&, mbgl::gfx::StencilMode const&, mbgl::gfx::ColorMode const&, mbgl::gfx::CullFaceMode const&, mbgl::gfx::IndexBuffer const&, std::__1::vector<mbgl::Segment<mbgl::TypeList<mbgl::attributes::pos>>, std::__1::allocator<mbgl::Segment<mbgl::TypeList<mbgl::attributes::pos>>>> const&, mbgl::gfx::UniformValues<mbgl::TypeList<mbgl::uniforms::matrix>> const&, mbgl::gfx::AttributeBindings<mbgl::TypeList<mbgl::attributes::pos>> const&, mbgl::gfx::TextureBindings<mbgl::TypeList<>> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) + 192
11  Mapbox                                 0x10679e618 mbgl::PaintParameters::renderTileClippingMasks(std::__1::shared_ptr<std::__1::vector<std::__1::reference_wrapper<mbgl::RenderTile const>, std::__1::allocator<std::__1::reference_wrapper<mbgl::RenderTile const>>> const> const&) + 828
12  Mapbox                                 0x10678930c mbgl::RenderLineLayer::render(mbgl::PaintParameters&) + 68
13  Mapbox                                 0x1067b416c mbgl::Renderer::Impl::render(mbgl::RenderTree const&) + 1704
14  Mapbox                                 0x1067b2a40 mbgl::Renderer::render(std::__1::shared_ptr<mbgl::UpdateParameters> const&) + 64
15  Mapbox                                 0x1069d28bc MGLRenderFrontend::render() + 68 (MGLRendererFrontend.h:57) [inlined]
16  Mapbox                                 0x1069d28bc -[MGLMapView renderSync] + 212 (MGLMapView.mm:1025)
17  Mapbox                                 0x1069968b8 MGLMapViewImpl::render() + 16 (MGLMapView+Impl.mm:14) [inlined]
18  Mapbox                                 0x1069968b8 -[MGLMapViewImplDelegate glkView:drawInRect:] + 32 (MGLMapView+OpenGL.mm:26)
19  GLKit                                  0x1b80d156c -[GLKView _display:] + 184
20  QuartzCore                             0x18a1b9518 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 392
21  QuartzCore                             0x18a0f2d30 CA::Context::commit_transaction(CA::Transaction*, double, double*) + 460
22  QuartzCore                             0x18a122aa8 CA::Transaction::commit() + 652
23  QuartzCore                             0x18a026f0c CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 1296
24  QuartzCore                             0x18a127a70 display_timer_callback(__CFMachPort*, void*, long, void*) + 336
25  CoreFoundation                         0x1803d8a60 __CFMachPortPerform + 172
26  CoreFoundation                         0x18040f5c8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56
27  CoreFoundation                         0x18040eb98 __CFRunLoopDoSource1 + 496
28  CoreFoundation                         0x1804091a8 __CFRunLoopRun + 2176
29  CoreFoundation                         0x180408514 CFRunLoopRunSpecific + 572
30  GraphicsServices                       0x18ef06ae4 GSEventRunModal + 160
31  UIKitCore                              0x1853e8040 -[UIApplication _run] + 868
32  UIKitCore                              0x1853ebcc8 UIApplicationMain + 124
33  Runner                                 0x104ed1fb8 main + 64 (AppDelegate.swift:5)
34  dyld_sim                               0x104f45544 start_sim + 20
35  dyld                                   0x1050420e0 start + 2360

I can't test on my iPhone I need to create my Apple dev account before. But if you have an idea of what's going on here, don't hesitate to tell me if I did something wrong!

Etheonor commented 3 months ago

I can confirm it only happened with iOS 17.4, I reinstalled a 17.2 simulator and everything's fine...

Camerash commented 3 months ago

+1 on this, experiencing this as well!

m0nac0 commented 3 months ago

Thanks for sharing, has anyone seen this on a real device as well?

T-moz commented 3 months ago

Thanks for sharing, has anyone seen this on a real device as well?

On my side it work on real devices. It crashes only on iOS simulator, under iOS 17.4

m0nac0 commented 3 months ago

There are reports upstream in the maplibre-native repo (https://github.com/maplibre/maplibre-native/issues/2189) of the iOS 17.4 simulator crashing with the 5.x.x version of the MapLibre iOS SDK, which we are using at the moment. So this is likely an issue with the OpenGL simulation in the iOS 17.4 simulator, but should not impact real devices.

Workaround is using any other (lower) simulator version. A fix would be transiting to use v6.x of the MapLibre iOS SDK (see #389)

Etheonor commented 3 months ago

Thanks you!

Yep as a workaround I'm now using a 17.2 simulator. My biggest problem would have been to see that this was also the case on a real device, but since you confirm that it isn't, it's not necessarily a big deal!