Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

XCode 13.3, iOS 15.4 - MGLMapView renderSync #650

Open
nitrag opened this issue Mar 24, 2022 · 33 comments
Open

XCode 13.3, iOS 15.4 - MGLMapView renderSync #650

nitrag opened this issue Mar 24, 2022 · 33 comments

Comments

@nitrag
Copy link
Contributor

nitrag commented Mar 24, 2022

So this just started happening when map is first being loaded. I have not made any local changes to my app.

Steps to reproduce

  1. Open project, build, deploy

Expected behavior

Actual behavior

Thread 1: EXC_BAD_ACCESS (code=1, address=0x7fda25d7bf60)

#0	0x00007fff4020e756 in glvmRasterOpDepthStencilTest ()
#1	0x00007fff4025d195 in glvmInterpretFPTransformFour ()
#2	0x00007fff5bca3f8e in gldLLVMFPTransform ()
#3	0x00007fff5bcb80c4 in gldLLVMVecPolyRender ()
#4	0x00007fff5bca0540 in gldRenderFillPolygonPtr ()
#5	0x00007fff401bdd21 in gleLLVMVecPrimMultiRender ()
#6	0x00007fff400fd6f7 in gleFlushAtomicFunc ()
#7	0x00007fff4014a10d in glDrawElements_IMM_ES2Exec ()
#8	0x00000001085029fa in mbgl::gl::Context::draw(mbgl::gfx::DrawMode const&, unsigned long, unsigned long) ()
#9	0x00000001085727f3 in mbgl::gl::Program<mbgl::LineSDFProgram>::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, mbgl::uniforms::ratio, mbgl::uniforms::units_to_pixels, mbgl::uniforms::device_pixel_ratio, mbgl::uniforms::patternscale_a, mbgl::uniforms::patternscale_b, mbgl::uniforms::tex_y_a, mbgl::uniforms::tex_y_b, mbgl::uniforms::mix, mbgl::uniforms::sdfgamma, mbgl::InterpolationUniform<mbgl::attributes::blur>, mbgl::InterpolationUniform<mbgl::attributes::color>, mbgl::InterpolationUniform<mbgl::attributes::floorwidth>, mbgl::InterpolationUniform<mbgl::attributes::gapwidth>, mbgl::InterpolationUniform<mbgl::attributes::offset>, mbgl::InterpolationUniform<mbgl::attributes::opacity>, mbgl::InterpolationUniform<mbgl::attributes::pattern_to>, mbgl::InterpolationUniform<mbgl::attributes::pattern_from>, mbgl::InterpolationUniform<mbgl::attributes::pixel_ratio_to>, mbgl::InterpolationUniform<mbgl::attributes::pixel_ratio_from>, mbgl::InterpolationUniform<mbgl::attributes::width>, mbgl::uniforms::blur, mbgl::uniforms::color, mbgl::uniforms::floorwidth, mbgl::uniforms::gapwidth, mbgl::uniforms::offset, mbgl::uniforms::opacity, mbgl::uniforms::pattern_to, mbgl::uniforms::pattern_from, mbgl::uniforms::pixel_ratio_to, mbgl::uniforms::pixel_ratio_from, mbgl::uniforms::width> > const&, mbgl::gfx::DrawScope&, mbgl::gfx::AttributeBindings<mbgl::TypeList<mbgl::attributes::pos_normal, mbgl::attributes::data<unsigned char, 4ul>, mbgl::attributes::linesofar, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::blur>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::color>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::floorwidth>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::gapwidth>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::offset>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::opacity>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::pattern_to>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::pattern_from>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::pixel_ratio_to>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::pixel_ratio_from>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::width> > > const&, mbgl::gfx::TextureBindings<mbgl::TypeList<mbgl::textures::image> > const&, mbgl::gfx::IndexBuffer const&, unsigned long, unsigned long) ()
#10	0x00000001085ddc86 in void mbgl::Program<mbgl::LineSDFProgram, (mbgl::gfx::PrimitiveType)2, mbgl::TypeList<mbgl::attributes::pos_normal, mbgl::attributes::data<unsigned char, 4ul>, mbgl::attributes::linesofar>, mbgl::TypeList<mbgl::uniforms::matrix, mbgl::uniforms::ratio, mbgl::uniforms::units_to_pixels, mbgl::uniforms::device_pixel_ratio, mbgl::uniforms::patternscale_a, mbgl::uniforms::patternscale_b, mbgl::uniforms::tex_y_a, mbgl::uniforms::tex_y_b, mbgl::uniforms::mix, mbgl::uniforms::sdfgamma>, mbgl::TypeList<mbgl::textures::image>, mbgl::style::LinePaintProperties, mbgl::TypeList<> >::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, std::__1::allocator<mbgl::Segment> > const&, mbgl::gfx::UniformValues<mbgl::TypeList<mbgl::uniforms::matrix, mbgl::uniforms::ratio, mbgl::uniforms::units_to_pixels, mbgl::uniforms::device_pixel_ratio, mbgl::uniforms::patternscale_a, mbgl::uniforms::patternscale_b, mbgl::uniforms::tex_y_a, mbgl::uniforms::tex_y_b, mbgl::uniforms::mix, mbgl::uniforms::sdfgamma, mbgl::InterpolationUniform<mbgl::attributes::blur>, mbgl::InterpolationUniform<mbgl::attributes::color>, mbgl::InterpolationUniform<mbgl::attributes::floorwidth>, mbgl::InterpolationUniform<mbgl::attributes::gapwidth>, mbgl::InterpolationUniform<mbgl::attributes::offset>, mbgl::InterpolationUniform<mbgl::attributes::opacity>, mbgl::InterpolationUniform<mbgl::attributes::pattern_to>, mbgl::InterpolationUniform<mbgl::attributes::pattern_from>, mbgl::InterpolationUniform<mbgl::attributes::pixel_ratio_to>, mbgl::InterpolationUniform<mbgl::attributes::pixel_ratio_from>, mbgl::InterpolationUniform<mbgl::attributes::width>, mbgl::uniforms::blur, mbgl::uniforms::color, mbgl::uniforms::floorwidth, mbgl::uniforms::gapwidth, mbgl::uniforms::offset, mbgl::uniforms::opacity, mbgl::uniforms::pattern_to, mbgl::uniforms::pattern_from, mbgl::uniforms::pixel_ratio_to, mbgl::uniforms::pixel_ratio_from, mbgl::uniforms::width> > const&, mbgl::gfx::AttributeBindings<mbgl::TypeList<mbgl::attributes::pos_normal, mbgl::attributes::data<unsigned char, 4ul>, mbgl::attributes::linesofar, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::blur>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::color>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::floorwidth>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::gapwidth>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::offset>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::opacity>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::pattern_to>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::pattern_from>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::pixel_ratio_to>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::pixel_ratio_from>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::width> > > const&, mbgl::gfx::TextureBindings<mbgl::TypeList<mbgl::textures::image> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) ()
#11	0x00000001085d9ebc in mbgl::RenderLineLayer::render(mbgl::PaintParameters&) ()
#12	0x00000001086179aa in mbgl::Renderer::Impl::render(mbgl::RenderTree const&) ()
#13	0x0000000108615cc3 in mbgl::Renderer::render(std::__1::shared_ptr<mbgl::UpdateParameters> const&) ()
#14	0x00000001088e4d2c in MGLRenderFrontend::render() [inlined] at /Users/distiller/project/platform/darwin/src/MGLRendererFrontend.h:57
#15	0x00000001088e4ce8 in -[MGLMapView renderSync] at /Users/distiller/project/platform/ios/src/MGLMapView.mm:1161
#16	0x000000010889961b in MGLMapViewImpl::render() [inlined] at /Users/distiller/project/platform/ios/src/MGLMapView+Impl.mm:18
#17	0x00000001088995ff in -[MGLMapViewImplDelegate glkView:drawInRect:] at /Users/distiller/project/platform/ios/src/MGLMapView+OpenGL.mm:30
#18	0x00007fff4ef6a3f4 in -[GLKView _display:] ()
#19	0x00007fff28a71721 in CA::Layer::layout_and_display_if_needed(CA::Transaction*) ()
#20	0x00007fff289937c9 in CA::Context::commit_transaction(CA::Transaction*, double, double*) ()
#21	0x00007fff289cae86 in CA::Transaction::commit() ()
#22	0x00007fff289cc104 in CA::Transaction::flush_as_runloop_observer(bool) ()
#23	0x00007fff2037267d in __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ ()
#24	0x00007fff2036ce41 in __CFRunLoopDoObservers ()
#25	0x00007fff2036d3d9 in __CFRunLoopRun ()
#26	0x00007fff2036ca90 in CFRunLoopRunSpecific ()
#27	0x00007fff2cb72c8e in GSEventRunModal ()
#28	0x00007fff2508e90e in -[UIApplication _run] ()
#29	0x00007fff25093569 in UIApplicationMain ()
#30	0x000000010625911f in main at /Users/ryan/Documents/TrailsOffroad/ios/trailsoffroad/Supporting Files/AppDelegate.swift:22
#31	0x0000000106af5f21 in start_sim ()
#32	0x00000001104564fe in start ()

Configuration

Mapbox SDK versions: 6.4.1
iOS/macOS versions: iOS 15.4
Device/simulator models: Simulator Version 13.3 (977.2)
Xcode version: Version 13.3 (13E113)

Probably related to this persons issue as well mapbox/mapbox-gl-js#11633

@VegaChen-BadtzMaru
Copy link

I have the same problem. xcode update to 13.3, when first load mapbox component then app crashed.

@domingues-dev
Copy link

Same here.
Mapbox SDK versions: 6.3.0
iOS/macOS versions: iOS 15.4
Device/simulator models: Simulator Version 13.3 (977.2)
Xcode version: Version 13.3 (13E113)

@Arthur-Guillaume
Copy link

Same here:
MapBox SDK: 6.4.1
iPhone 12 simulator / iOS 15.4
Xcode 13.3

@knov
Copy link
Contributor

knov commented Mar 30, 2022

Thanks for the feedback. A few questions:

  • Are you seeing this issue on device or just when using simulator?
  • Are you using our SDK with React Native or directly in iOS?

@Arthur-Guillaume
Copy link

Hi,
Thanks for the reply.

I am using your SDK directly in iOS.
Issue happens only with simulator, no problem on an actual device.

Hope it helps :-)

@mattijsf
Copy link

mattijsf commented Apr 5, 2022

I got the same error using Xcode 13.3 and iOS 15.4 Simulator:

When trying to figure out what could cause the crash I reduced te map to load just te base style. When disabling all sources / layers the map loaded just fine. Then I started adding sources + layers gradually. I ended up having everything back on the map without crash so I'm no not certain on what caused it.

Mapbox-iOS-SDK: 6.3.0
MapboxMobileEvents: 0.10.14:

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

Incident Identifier: 09FD1FC2-617B-4408-96FC-B6A08BF77A15
CrashReporter Key:   277D161A-8455-36A2-70BD-A3F4714FD419
Hardware Model:      MacBookPro14,3
Process:             - [7992]
Path:                /Users/USER/Library/Developer/CoreSimulator/Devices/328AC647-19E9-4D1F-B395-13FB5B77E3F1/data/Containers/Bundle/Application/884DBF4F-D822-485E-9ECE-96B676E78CC0/-.app/-
Identifier:          -
Version:             -
Code Type:           X86-64 (Native)
Role:                Foreground
Parent Process:      launchd_sim [7339]
Coalition:           com.apple.CoreSimulator.SimDevice.328AC647-19E9-4D1F-B395-13FB5B77E3F1 [3162]
Responsible Process: SimulatorTrampoline [1338]

Date/Time:           2022-04-05 09:38:53.2213 +0200
Launch Time:         2022-04-05 09:38:42.8388 +0200
OS Version:          macOS 12.3.1 (21E258)
Release Type:        User
Report Version:      104

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x00007fdb464d8fc0
Exception Codes: 0x0000000000000001, 0x00007fdb464d8fc0
VM Region Info: 0x7fdb464d8fc0 is not in any region.  Bytes after previous region: 3778908097  Bytes before following region: 122151280704
      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      MALLOC_TINY              7fda65000000-7fda65100000 [ 1024K] rw-/rwx SM=PRV  
--->  GAP OF 0x1d52063000 BYTES
      Stack Guard              7ff7b7163000-7ff7ba963000 [ 56.0M] ---/rwx SM=NUL  
Exception Note:  EXC_CORPSE_NOTIFY
Termination Reason: SIGNAL 11 Segmentation fault: 11
Terminating Process: exc handler [7992]

Triggered by Thread:  0

Application Specific Information:
CoreSimulator 802.6 - Device: iPhone 12 (328AC647-19E9-4D1F-B395-13FB5B77E3F1) - Runtime: iOS 15.4 (19E240) - DeviceType: iPhone 12
dyld4 config: DYLD_ROOT_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot
dyld4 config: DYLD_ROOT_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot


Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   libGLProgrammability.dylib    	    0x7fff4020e756 glvmRasterOpDepthStencilTest + 438
1   libGLProgrammability.dylib    	    0x7fff4025d195 glvmInterpretFPTransformFour + 2405
2   GLRendererFloat               	    0x7fff5bca3f8e gldLLVMFPTransform + 734
3   GLRendererFloat               	    0x7fff5bcb80c4 gldLLVMVecPolyRender + 23124
4   GLRendererFloat               	    0x7fff5bca0540 gldRenderFillPolygonPtr + 90
5   GLEngine                      	    0x7fff401bdd21 gleLLVMVecPrimMultiRender + 4593
6   GLEngine                      	    0x7fff400fd6f7 gleFlushAtomicFunc + 15
7   GLEngine                      	    0x7fff4014a10d glDrawElements_IMM_ES2Exec + 925
8   Mapbox                        	       0x10a18073a mbgl::gl::Context::draw(mbgl::gfx::DrawMode const&, unsigned long, unsigned long) + 138
9   Mapbox                        	       0x10a1e8367 mbgl::gl::Program<mbgl::LineProgram>::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, mbgl::uniforms::ratio, mbgl::uniforms::units_to_pixels, mbgl::uniforms::device_pixel_ratio, mbgl::InterpolationUniform<mbgl::attributes::blur>, mbgl::InterpolationUniform<mbgl::attributes::color>, mbgl::InterpolationUniform<mbgl::attributes::floorwidth>, mbgl::InterpolationUniform<mbgl::attributes::gapwidth>, mbgl::InterpolationUniform<mbgl::attributes::offset>, mbgl::InterpolationUniform<mbgl::attributes::opacity>, mbgl::InterpolationUniform<mbgl::attributes::pattern_to>, mbgl::InterpolationUniform<mbgl::attributes::pattern_from>, mbgl::InterpolationUniform<mbgl::attributes::pixel_ratio_to>, mbgl::InterpolationUniform<mbgl::attributes::pixel_ratio_from>, mbgl::InterpolationUniform<mbgl::attributes::width>, mbgl::uniforms::blur, mbgl::uniforms::color, mbgl::uniforms::floorwidth, mbgl::uniforms::gapwidth, mbgl::uniforms::offset, mbgl::uniforms::opacity, mbgl::uniforms::pattern_to, mbgl::uniforms::pattern_from, mbgl::uniforms::pixel_ratio_to, mbgl::uniforms::pixel_ratio_from, mbgl::uniforms::width> > const&, mbgl::gfx::DrawScope&, mbgl::gfx::AttributeBindings<mbgl::TypeList<mbgl::attributes::pos_normal, mbgl::attributes::data<unsigned char, 4ul>, mbgl::attributes::linesofar, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::blur>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::color>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::floorwidth>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::gapwidth>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::offset>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::opacity>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::pattern_to>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::pattern_from>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::pixel_ratio_to>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::pixel_ratio_from>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::width> > > const&, mbgl::gfx::TextureBindings<mbgl::TypeList<> > const&, mbgl::gfx::IndexBuffer const&, unsigned long, unsigned long) + 743
10  Mapbox                        	       0x10a25e036 void mbgl::Program<mbgl::LineProgram, (mbgl::gfx::PrimitiveType)2, mbgl::TypeList<mbgl::attributes::pos_normal, mbgl::attributes::data<unsigned char, 4ul>, mbgl::attributes::linesofar>, mbgl::TypeList<mbgl::uniforms::matrix, mbgl::uniforms::ratio, mbgl::uniforms::units_to_pixels, mbgl::uniforms::device_pixel_ratio>, mbgl::TypeList<>, mbgl::style::LinePaintProperties, mbgl::TypeList<> >::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, std::__1::allocator<mbgl::Segment> > const&, mbgl::gfx::UniformValues<mbgl::TypeList<mbgl::uniforms::matrix, mbgl::uniforms::ratio, mbgl::uniforms::units_to_pixels, mbgl::uniforms::device_pixel_ratio, mbgl::InterpolationUniform<mbgl::attributes::blur>, mbgl::InterpolationUniform<mbgl::attributes::color>, mbgl::InterpolationUniform<mbgl::attributes::floorwidth>, mbgl::InterpolationUniform<mbgl::attributes::gapwidth>, mbgl::InterpolationUniform<mbgl::attributes::offset>, mbgl::InterpolationUniform<mbgl::attributes::opacity>, mbgl::InterpolationUniform<mbgl::attributes::pattern_to>, mbgl::InterpolationUniform<mbgl::attributes::pattern_from>, mbgl::InterpolationUniform<mbgl::attributes::pixel_ratio_to>, mbgl::InterpolationUniform<mbgl::attributes::pixel_ratio_from>, mbgl::InterpolationUniform<mbgl::attributes::width>, mbgl::uniforms::blur, mbgl::uniforms::color, mbgl::uniforms::floorwidth, mbgl::uniforms::gapwidth, mbgl::uniforms::offset, mbgl::uniforms::opacity, mbgl::uniforms::pattern_to, mbgl::uniforms::pattern_from, mbgl::uniforms::pixel_ratio_to, mbgl::uniforms::pixel_ratio_from, mbgl::uniforms::width> > const&, mbgl::gfx::AttributeBindings<mbgl::TypeList<mbgl::attributes::pos_normal, mbgl::attributes::data<unsigned char, 4ul>, mbgl::attributes::linesofar, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::blur>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::color>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::floorwidth>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::gapwidth>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::offset>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::opacity>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::pattern_to>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::pattern_from>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::pixel_ratio_to>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::pixel_ratio_from>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::width> > > const&, mbgl::gfx::TextureBindings<mbgl::TypeList<> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 230
11  Mapbox                        	       0x10a258cc3 mbgl::RenderLineLayer::render(mbgl::PaintParameters&) + 4243
12  Mapbox                        	       0x10a29639b mbgl::Renderer::Impl::render(mbgl::RenderTree const&) + 2635
13  Mapbox                        	       0x10a2946b3 mbgl::Renderer::render(std::__1::shared_ptr<mbgl::UpdateParameters> const&) + 51
14  Mapbox                        	       0x10a56c60c MGLRenderFrontend::render() + 68 (MGLRendererFrontend.h:57) [inlined]
15  Mapbox                        	       0x10a56c60c -[MGLMapView renderSync] + 813 (MGLMapView.mm:1161)
16  Mapbox                        	       0x10a520e17 MGLMapViewImpl::render() + 31 (MGLMapView+Impl.mm:18) [inlined]
17  Mapbox                        	       0x10a520e17 -[MGLMapViewImplDelegate glkView:drawInRect:] + 43 (MGLMapView+OpenGL.mm:30)
18  GLKit                         	    0x7fff4ef6a3f4 -[GLKView _display:] + 267
19  QuartzCore                    	    0x7fff28a71721 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 479
20  QuartzCore                    	    0x7fff289937c9 CA::Context::commit_transaction(CA::Transaction*, double, double*) + 623
21  QuartzCore                    	    0x7fff289cae86 CA::Transaction::commit() + 774
22  QuartzCore                    	    0x7fff289cc104 CA::Transaction::flush_as_runloop_observer(bool) + 60
23  CoreFoundation                	    0x7fff2037267d __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
24  CoreFoundation                	    0x7fff2036ce41 __CFRunLoopDoObservers + 570
25  CoreFoundation                	    0x7fff2036d3d9 __CFRunLoopRun + 1100
26  CoreFoundation                	    0x7fff2036ca90 CFRunLoopRunSpecific + 562
27  GraphicsServices              	    0x7fff2cb72c8e GSEventRunModal + 139
28  UIKitCore                     	    0x7fff2508e90e -[UIApplication _run] + 928
29  UIKitCore                     	    0x7fff25093569 UIApplicationMain + 101
30  -                        	       0x104da2298 main + 104 (main.m:7)
31  dyld_sim                      	       0x1092f6f21 start_sim + 10
32  dyld                          	       0x1169f151e start + 462

@jorgealegre
Copy link

We're also getting the same crash with Xcode 13.3

@ionutivan
Copy link

I have the same crash. Only in simulator.
Xcode 13.3
iOS 15.4

@malaba
Copy link

malaba commented Apr 6, 2022

I have the same crash: simulator only, Xcode 13.3, iOS 15.4, and using the mapbox sdk directly in iOS.

If it can help:

  • the crash is systematic 100% of the time
  • but if I disable the Allow Location Simulation in the Scheme then it works (I need to restart both Xcode and the simulator and clean build folder before rebuilding). Now it works 100% of the time (I can launch many time over). I just don't have a GPS location and then of course my app is mostly useless.

So it seems related to the handling of the current location ?

I also managed to make it run once (then the second time it crash) by commenting out in my code a line:

// mapView.showsUserLocation = true

@csaper
Copy link

csaper commented Apr 29, 2022

I'm able to consistently replicate the crash in my simulator environment:

Xcode: 13.3.1 (13E500a)
Mapbox iOS SDK: 6.3.0
Simulator: iPad 9th Generation - iOS 15.4

Crashed: com.apple.main-thread
0  libGLProgrammability.dylib     0x37756 glvmRasterOpDepthStencilTest + 438
1  libGLProgrammability.dylib     0x86195 glvmInterpretFPTransformFour + 2405
2  GLRendererFloat                0x12f8e gldLLVMFPTransform + 734
3  GLRendererFloat                0x270c4 gldLLVMVecPolyRender + 23124
4  GLRendererFloat                0xf540 gldRenderFillPolygonPtr + 90
5  ???                            0x14d69c16e (Missing)
6  GLEngine                       0x1e6f7 gleFlushAtomicFunc + 15
7  GLEngine                       0x6b10d glDrawElements_IMM_ES2Exec + 925
8  Mapbox                         0x8873a mbgl::gl::Context::draw(mbgl::gfx::DrawMode const&, unsigned long, unsigned long) + 138
9  Mapbox                         0xf9333 mbgl::gl::Program<mbgl::LineSDFProgram>::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, mbgl::uniforms::ratio, mbgl::uniforms::units_to_pixels, mbgl::uniforms::device_pixel_ratio, mbgl::uniforms::patternscale_a, mbgl::uniforms::patternscale_b, mbgl::uniforms::tex_y_a, mbgl::uniforms::tex_y_b, mbgl::uniforms::mix, mbgl::uniforms::sdfgamma, mbgl::InterpolationUniform<mbgl::attributes::blur>, mbgl::InterpolationUniform<mbgl::attributes::color>, mbgl::InterpolationUniform<mbgl::attributes::floorwidth>, mbgl::InterpolationUniform<mbgl::attributes::gapwidth>, mbgl::InterpolationUniform<mbgl::attributes::offset>, mbgl::InterpolationUniform<mbgl::attributes::opacity>, mbgl::InterpolationUniform<mbgl::attributes::pattern_to>, mbgl::InterpolationUniform<mbgl::attributes::pattern_from>, mbgl::InterpolationUniform<mbgl::attributes::pixel_ratio_to>, mbgl::InterpolationUniform<mbgl::attributes::pixel_ratio_from>, mbgl::InterpolationUniform<mbgl::attributes::width>, mbgl::uniforms::blur, mbgl::uniforms::color, mbgl::uniforms::floorwidth, mbgl::uniforms::gapwidth, mbgl::uniforms::offset, mbgl::uniforms::opacity, mbgl::uniforms::pattern_to, mbgl::uniforms::pattern_from, mbgl::uniforms::pixel_ratio_to, mbgl::uniforms::pixel_ratio_from, mbgl::uniforms::width> > const&, mbgl::gfx::DrawScope&, mbgl::gfx::AttributeBindings<mbgl::TypeList<mbgl::attributes::pos_normal, mbgl::attributes::data<unsigned char, 4ul>, mbgl::attributes::linesofar, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::blur>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::color>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::floorwidth>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::gapwidth>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::offset>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::opacity>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::pattern_to>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::pattern_from>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::pixel_ratio_to>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::pixel_ratio_from>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::width> > > const&, mbgl::gfx::TextureBindings<mbgl::TypeList<mbgl::textures::image> > const&, mbgl::gfx::IndexBuffer const&, unsigned long, unsigned long) + 899
10 Mapbox                         0x163fb6 void mbgl::Program<mbgl::LineSDFProgram, (mbgl::gfx::PrimitiveType)2, mbgl::TypeList<mbgl::attributes::pos_normal, mbgl::attributes::data<unsigned char, 4ul>, mbgl::attributes::linesofar>, mbgl::TypeList<mbgl::uniforms::matrix, mbgl::uniforms::ratio, mbgl::uniforms::units_to_pixels, mbgl::uniforms::device_pixel_ratio, mbgl::uniforms::patternscale_a, mbgl::uniforms::patternscale_b, mbgl::uniforms::tex_y_a, mbgl::uniforms::tex_y_b, mbgl::uniforms::mix, mbgl::uniforms::sdfgamma>, mbgl::TypeList<mbgl::textures::image>, mbgl::style::LinePaintProperties, mbgl::TypeList<> >::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, std::__1::allocator<mbgl::Segment> > const&, mbgl::gfx::UniformValues<mbgl::TypeList<mbgl::uniforms::matrix, mbgl::uniforms::ratio, mbgl::uniforms::units_to_pixels, mbgl::uniforms::device_pixel_ratio, mbgl::uniforms::patternscale_a, mbgl::uniforms::patternscale_b, mbgl::uniforms::tex_y_a, mbgl::uniforms::tex_y_b, mbgl::uniforms::mix, mbgl::uniforms::sdfgamma, mbgl::InterpolationUniform<mbgl::attributes::blur>, mbgl::InterpolationUniform<mbgl::attributes::color>, mbgl::InterpolationUniform<mbgl::attributes::floorwidth>, mbgl::InterpolationUniform<mbgl::attributes::gapwidth>, mbgl::InterpolationUniform<mbgl::attributes::offset>, mbgl::InterpolationUniform<mbgl::attributes::opacity>, mbgl::InterpolationUniform<mbgl::attributes::pattern_to>, mbgl::InterpolationUniform<mbgl::attributes::pattern_from>, mbgl::InterpolationUniform<mbgl::attributes::pixel_ratio_to>, mbgl::InterpolationUniform<mbgl::attributes::pixel_ratio_from>, mbgl::InterpolationUniform<mbgl::attributes::width>, mbgl::uniforms::blur, mbgl::uniforms::color, mbgl::uniforms::floorwidth, mbgl::uniforms::gapwidth, mbgl::uniforms::offset, mbgl::uniforms::opacity, mbgl::uniforms::pattern_to, mbgl::uniforms::pattern_from, mbgl::uniforms::pixel_ratio_to, mbgl::uniforms::pixel_ratio_from, mbgl::uniforms::width> > const&, mbgl::gfx::AttributeBindings<mbgl::TypeList<mbgl::attributes::pos_normal, mbgl::attributes::data<unsigned char, 4ul>, mbgl::attributes::linesofar, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::blur>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::color>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::floorwidth>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::gapwidth>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::offset>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::opacity>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::pattern_to>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::pattern_from>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::pixel_ratio_to>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::pixel_ratio_from>, mbgl::ZoomInterpolatedAttribute<mbgl::attributes::width> > > const&, mbgl::gfx::TextureBindings<mbgl::TypeList<mbgl::textures::image> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 230
11 Mapbox                         0x1602cc mbgl::RenderLineLayer::render(mbgl::PaintParameters&) + 1692
12 Mapbox                         0x19e39b mbgl::Renderer::Impl::render(mbgl::RenderTree const&) + 2635
13 Mapbox                         0x19c6b3 mbgl::Renderer::render(std::__1::shared_ptr<mbgl::UpdateParameters> const&) + 51
14 Mapbox                         0x47460c -[MGLMapView renderSync] + 813
15 Mapbox                         0x428e17 -[MGLMapViewImplDelegate glkView:drawInRect:] + 43
16 GLKit                          0x1f3f4 -[GLKView _display:] + 267
17 QuartzCore                     0x1b0721 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 479
18 QuartzCore                     0xd27c9 CA::Context::commit_transaction(CA::Transaction*, double, double*) + 623
19 QuartzCore                     0x109e86 CA::Transaction::commit() + 774
20 QuartzCore                     0x10b104 CA::Transaction::flush_as_runloop_observer(bool) + 60
21 CoreFoundation                 0x8167d __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
22 CoreFoundation                 0x7be41 __CFRunLoopDoObservers + 570
23 CoreFoundation                 0x7c3d9 __CFRunLoopRun + 1100
24 CoreFoundation                 0x7ba90 CFRunLoopRunSpecific + 562
25 GraphicsServices               0x3c8e GSEventRunModal + 139
26 UIKitCore                      0xcda90e -[UIApplication _run] + 928
27 UIKitCore                      0xcdf569 UIApplicationMain + 101
28 –                           0x6044 main + 17 (main.m:17)
29 ???                            0x1094d0f21 (Missing)
30 ???                            0x200e9251e (Missing)

This does not appear to affect device builds.

@danieleMarenco
Copy link

the same problem

@iMark21
Copy link

iMark21 commented May 10, 2022

Same problem here!

@jrodin
Copy link

jrodin commented May 16, 2022

yup, encountering the same problem

@dayanruben
Copy link

dayanruben commented May 17, 2022

Mapbox SDK version: 6.4.1
Device Type: Physical
iPadOS version: 15.4.1 (88%), 15.5.0 (5%), 15.4.0 (2%)

Stack trace:

Crashed: com.apple.main-thread
0  libsystem_kernel.dylib         0x7b38 __pthread_kill + 8
1  libsystem_pthread.dylib        0x73bc pthread_kill + 268
2  libsystem_c.dylib              0x20524 abort + 168
3  libGFXShared.dylib             0x3e08 gfxFreeTextureLevel + 206
4  GLEngine                       0x13be8 glTexImage2D_Exec
5  OpenGLES                       0x2d80 glTexImage2D + 84
6  Mapbox                         0x95088 mbgl::gl::UploadPass::updateTextureResource(mbgl::gfx::TextureResource&, mbgl::Size, void const*, mbgl::gfx::TexturePixelType, mbgl::gfx::TextureChannelDataType) + 581320
7  Mapbox                         0x94eac mbgl::gl::UploadPass::createTextureResource(mbgl::Size, void const*, mbgl::gfx::TexturePixelType, mbgl::gfx::TextureChannelDataType, bool) + 580844
8  Mapbox                         0x1179fc mbgl::RasterBucket::upload(mbgl::gfx::UploadPass&) + 1116220
9  Mapbox                         0x181dd0 mbgl::RenderTile::upload(mbgl::gfx::UploadPass&) const + 1551376
10 Mapbox                         0x18d854 mbgl::TileSourceRenderItem::upload(mbgl::gfx::UploadPass&) const + 1599124
11 Mapbox                         0x183c28 mbgl::Renderer::Impl::render(mbgl::RenderTree const&) + 1559144
12 Mapbox                         0x182d58 mbgl::Renderer::render(std::__1::shared_ptr<mbgl::UpdateParameters> const&) + 1555352
13 Mapbox                         0x3e60ec -[MGLMapView renderSync] + 3883 (memory:3883)
14 Mapbox                         0x39bb2c -[MGLMapViewImplDelegate glkView:drawInRect:] + 18 (MGLMapView+Impl.mm:18)
15 GLKit                          0x1770 -[GLKView _display:] + 212
16 QuartzCore                     0x33250 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 420
17 QuartzCore                     0x47a7c CA::Context::commit_transaction(CA::Transaction*, double, double*) + 452
18 QuartzCore                     0x50970 CA::Transaction::commit() + 704
19 QuartzCore                     0x3288c CA::Transaction::flush_as_runloop_observer(bool) + 88
20 CoreFoundation                 0x410c4 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 36
21 CoreFoundation                 0x10080 __CFRunLoopDoObservers + 592
22 CoreFoundation                 0xb13c __CFRunLoopRun + 1052
23 CoreFoundation                 0x1ebc8 CFRunLoopRunSpecific + 600
24 GraphicsServices               0x1374 GSEventRunModal + 164
25 UIKitCore                      0x514648 -[UIApplication _run] + 1100
26 UIKitCore                      0x295d90 UIApplicationMain + 364
27 SwiftUI                        0x23ff24 closure #1 in KitRendererCommon(_:) + 164
28 SwiftUI                        0x16de08 runApp<A>(_:) + 252
29 SwiftUI                        0x14f0f4 static App.main() + 128
...

@jradasaurus
Copy link

Is anyone from Mapbox addressing this issue? Its extremely frustrating.

@xD3CODER
Copy link

Same problem here

1 similar comment
@mateuszmackowiak
Copy link

Same problem here

@csaper
Copy link

csaper commented Jun 1, 2022

Bringing @1ec5, @ZiZasaurus & @jmkiley into the conversation.

I know you guys have been working super hard on v10, but the legacy SDK (still officially Mapbox-supported until April 2023) could use a bit of attention. I know your customers and the developer community would very much appreciate resolutions to this and other persistent bugs.

Thanks!

@simon-abbott
Copy link

I get this just about every time I launch our app in the iOS simulator. Hasn't happened once on a physical device that I know of, but debugging our setup is much easier in the simulator. Xcode 13.4.1, iPhone 13 simulator running 15.5.

@teradyl
Copy link

teradyl commented Jun 16, 2022

Happens to me too on Xcode 13.4.1 and iOS 15.5. This is preventing me from testing map related things on simulator. I intend to upgrade to v10 eventually, but this is a big issue!

@csaper
Copy link

csaper commented Jun 17, 2022

@knov - 👋 Hi Kristen, I see you were involved in triaging this issue a few months ago. Would you mind bringing it to the attention of the MapBox SDK engineers please? 🙏

@1ec5
Copy link
Contributor

1ec5 commented Jun 21, 2022

Just driving by here, since I was pinged, but I haven’t worked on the map SDK for a long time and wasn’t involved in some of the more recent GLKit-related changes. I’ll defer to the map SDK team for an official response, but here are some observations based purely on the information in this issue.

I have the same crash: simulator only, Xcode 13.3, iOS 15.4, and using the mapbox sdk directly in iOS.

If it can help:

* the crash is systematic 100% of the time

* but if I disable the `Allow Location Simulation` in the Scheme then it works (I need to restart both Xcode and the simulator and clean build folder before rebuilding). Now it works 100% of the time (I can launch many time over). _I just don't have a GPS location and then of course my app is mostly useless_.

So it seems related to the handling of the current location ?

I also managed to make it run once (then the second time it crash) by commenting out in my code a line:

// mapView.showsUserLocation = true

If you’re only seeing this issue when the map view shows view-backed annotations, such as the user location indicator, then the introduction of CAEAGLLayer.presentsWithTransaction in mapbox/mapbox-gl-native#12895 and -[GLKView setNeedsDisplay] in #411 may be related somehow. MapLibre introduced a similar change in maplibre/maplibre-native#235. These changes were intended to synchronize frame-by-frame updates of view-backed annotations with the underlying map, which generally takes longer to render. There was a suggestion in mapbox/mapbox-gl-native#14232 (comment) that these changes should actually be rolled back, presumably based on an Apple feedback item getting marked as resolved. Setting MGLPresentsWithTransactionAnnotationCount would be one way to validate this hypothesis.

It looks like all the reports above were observed in a simulator, except for #650 (comment).

/ref mapbox/mapbox-maps-ios#979 (comment)

@csaper
Copy link

csaper commented Jun 21, 2022

Thanks for your feedback @1ec5! Since you aren't currently working on the iOS Maps SDK, would you please loop in any of the MB PMs/engineers who are currently involved? There doesn't seem to be anyone from Mapbox monitoring this repo anymore.

Appreciate it!

@1ec5
Copy link
Contributor

1ec5 commented Jun 22, 2022

Yes, they’re aware of this issue and will be following up as soon as they can.

@joshkopecek
Copy link

Anyone looking for a quick fix, I can confirm this crash does not occur when using the simulator with iOS 14.5, Mapbox v6.4.1.

Saved my neck when creating screenshots!

@nbers
Copy link

nbers commented Jul 7, 2022

I have the same exact issue, when is this expected to be fixed?

@PhungVanHoa
Copy link

encountering the same problem 😞

@Stophface
Copy link

Stophface commented Aug 8, 2022

I think there are two problems:

  1. When you open the Map, there is a Modal coming up asking for location permissions. Sometimes you do not see the Modal, because its rendered not fast enough and it crashes before it gets rendered. When its rendered you have to quickly Allow Location Services, otherwise the application will crash. Even if you click allow, the application might crash... Reopen and see, if the modal appears again.
  2. There seems to be a problem with the simulated location. Even if Location Services are enabled, when the Location is Simulated, it crashes... This seems unfixable.

This did not occur to me with version 8.5.0, but started happening when using 8.6.0-beta.0. Rolling back to 8.5.0 fixed this for me.

@viewDidAppear
Copy link

Same issue happening for months now too. iOS 16 is around the corner, and we still can't reliably test on iOS 15 Simulators. 😬

@csaper
Copy link

csaper commented Aug 17, 2022

Hi @maios, @pjleonard37 and @evil159 -- as active Mapbox iOS SDK engineers, I'd like to loop you in on this issue affecting the legacy SDK (which appears to be officially Mapbox-supported until April 4, 2023 per the docs.)

Your colleague @1ec5 mentioned in June that you guys would take a look at this bug and resolve ASAP. Could I kindly request on behalf of myself and other paying Mapbox customers that you please give this issue a glance?

I'd be happy to support in the debugging/testing process.

Many thanks! 🙌🏻

@1ec5
Copy link
Contributor

1ec5 commented Aug 19, 2022

Your colleague @1ec5 mentioned in June that you guys would take a look at this bug and resolve ASAP.

Just to be clear, I wasn’t making any promises about resolving the issue ASAP. If I was that sure about how to fix the issue, it probably would’ve been fixed already by someone more familiar with the underlying graphics code than I am. 😅

For what it’s worth, I personally find it very difficult to reproduce the issue. It happens sometimes but not frequently enough to experiment with any speculative workarounds. Maybe I’m just getting (un)lucky for the time being, but if any of you notice anything else unusual during debugging, that information could lead to a faster resolution than me killing some downtime by rerunning iosapp in a loop.

@malaba
Copy link

malaba commented Aug 19, 2022

@1ec5 For me it crash 100% of the time. So to help you I created a minimal project where it also crash 100% of the time:

https://github.com/malaba/MapBoxCrash.git

Just follow the instruction in the README.md

Let's work from there.
Brgds,

@1ec5
Copy link
Contributor

1ec5 commented Sep 13, 2022

Same issue happening for months now too. iOS 16 is around the corner, and we still can't reliably test on iOS 15 Simulators. 😬

MapLibre users report that Apple has fixed the issue in the iOS 16 simulator in Xcode 14: maplibre/maplibre-native#268 (comment). Similarly, in this project, I haven’t encountered this crash in the iOS 16 simulator so far using iosapp, whereas it does reproduce occasionally for me in the iOS 15 simulator.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests