Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Sporadic crash in MGLRenderFrontend.render()  #16646

Open

Description

@BinaryDennis

Im using Flutter MapBox GL (https://github.com/flutter-mapbox-gl/maps), which is a wrapper on this library/repo. Im not 100% sure if the crash occurs in this lib or the wrapper lib.

Below is a screenshot of the crash in Xcode. It occurs too often to be neglected.

Screenshot 2022-07-10 at 17 54 45

Steps to reproduce

I cannot say exactly how to trigger the crash but it seems to be just after the style has been loaded.

This is how I configure MapboxMap (note that the style URL is public so you can test this use case).

      MapboxMap(
        styleString: "mapbox://styles/charmington/cl5e7uml0001p14r79ybci4eq",
        accessToken: MyApp.ACCESS_TOKEN,
        tiltGesturesEnabled: false,
        myLocationEnabled: true,
        myLocationTrackingMode: MyLocationTrackingMode.Tracking,
        myLocationRenderMode: MyLocationRenderMode.COMPASS,
        compassViewPosition: CompassViewPosition.TopLeft,
        initialCameraPosition: CameraPosition(
          zoom: 1.0,
          target: LatLng(60.15860080718994, 24.922044798731804),
        )
      );

Expected behavior

App not crashing

Actual behavior

App crashing

Configuration

Mapbox SDK versions:
Mapbox-gl 0.16.0
Mapbox-gl-dart 0.2.1
Flutter 3.0.4
Dart 2.17.5
DevTools 2.12.2

iOS/macOS versions:
macOS Monterey 12.4

Device/simulator models:
iOS simulator - iPhone 11 Pro - iOS 15.5

Xcode version:
13.4.1

Activity

  1. BinaryDennis commented on Jul 29, 2022

    @BinaryDennis
    Author

    Perhaps this crash log can give some more hints...

    Also, it seems to occur when zoom level is ~6, and the position of the camera is close to a place where there are a lot of lines and circles, eg

    LatLng(60.15445000492036, 24.674159986898303)

    Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
    Exception Subtype: KERN_INVALID_ADDRESS at 0x00007fea4d60dfd0
    Exception Codes: 0x0000000000000001, 0x00007fea4d60dfd0
    VM Region Info: 0x7fea4d60dfd0 is not in any region.  Bytes after previous region: 4286635985  Bytes before following region: 58827632688
          REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
          MALLOC_LARGE             7fe94dd00000-7fe94de00000 [ 1024K] rw-/rwx SM=PRV  
    --->  GAP OF 0xeb1e75000 BYTES
          mapped file              7ff7ffc75000-7ff7ffca5000 [  192K] r-x/r-x SM=COW  ...t_id=bc16dd1d
    Exception Note:  EXC_CORPSE_NOTIFY
    Termination Reason: SIGNAL 11 Segmentation fault: 11
    Terminating Process: exc handler [7071]
    
    Triggered by Thread:  0
    
    Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
    0   <translation info unavailable>	       0x108a1259c ???
    1   <translation info unavailable>	       0x108a107c4 ???
    2   libGLProgrammability.dylib    	       0x140b2f195 glvmInterpretFPTransformFour + 2405
    3   GLRendererFloat               	       0x139444f8e gldLLVMFPTransform + 734
    4   GLRendererFloat               	       0x1394590c4 gldLLVMVecPolyRender + 23124
    5   GLRendererFloat               	       0x139441540 gldRenderFillPolygonPtr + 90
    6   GLEngine                      	       0x14036bd21 gleLLVMVecPrimMultiRender + 4593
    7   GLEngine                      	       0x1402f26ea glDrawElements_ES2Exec + 1086
    8   Mapbox                        	       0x10b58f9fa mbgl::gl::Context::draw(mbgl::gfx::DrawMode const&, unsigned long, unsigned long) + 138
    9   Mapbox                        	       0x10b5e5f28 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) + 568
    10  Mapbox                        	       0x10b688db9 void mbgl::Program<mbgl::ClippingMaskProgram, (mbgl::gfx::PrimitiveType)2, mbgl::TypeList<mbgl::attributes::pos>, mbgl::TypeList<mbgl::uniforms::matrix>, mbgl::TypeList<>, mbgl::style::Properties<>, 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> > 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&) + 185
    11  Mapbox                        	       0x10b688c0d 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&) + 1053
    12  Mapbox                        	       0x10b666850 mbgl::RenderLineLayer::render(mbgl::PaintParameters&) + 48
    13  Mapbox                        	       0x10b6a49aa mbgl::Renderer::Impl::render(mbgl::RenderTree const&) + 2634
    14  Mapbox                        	       0x10b6a2cc3 mbgl::Renderer::render(std::__1::shared_ptr<mbgl::UpdateParameters> const&) + 51
    15  Mapbox                        	       0x10b971d2c MGLRenderFrontend::render() + 68 (MGLRendererFrontend.h:57) [inlined]
    16  Mapbox                        	       0x10b971d2c -[MGLMapView renderSync] + 813 (MGLMapView.mm:1161)
    17  Mapbox                        	       0x10b92661b MGLMapViewImpl::render() + 28 (MGLMapView+Impl.mm:18) [inlined]
    18  Mapbox                        	       0x10b92661b -[MGLMapViewImplDelegate glkView:drawInRect:] + 39 (MGLMapView+OpenGL.mm:30)
    19  GLKit                         	       0x10c8f63f4 -[GLKView _display:] + 267
    20  QuartzCore                    	       0x112f647a7 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 479
    21  QuartzCore                    	       0x112e868ed CA::Context::commit_transaction(CA::Transaction*, double, double*) + 623
    22  QuartzCore                    	       0x112ebdf6e CA::Transaction::commit() + 774
    23  QuartzCore                    	       0x112ebf1ec CA::Transaction::flush_as_runloop_observer(bool) + 60
    24  CoreFoundation                	       0x10bdef2f1 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
    25  CoreFoundation                	       0x10bde9ab5 __CFRunLoopDoObservers + 570
    26  CoreFoundation                	       0x10bdea04d __CFRunLoopRun + 1100
    27  CoreFoundation                	       0x10bde9704 CFRunLoopRunSpecific + 562
    28  GraphicsServices              	       0x1153b8c8e GSEventRunModal + 139
    29  UIKitCore                     	       0x11c23565a -[UIApplication _run] + 928
    30  UIKitCore                     	       0x11c23a2b5 UIApplicationMain + 101
    31  Runner                        	       0x1023d521f main + 63 (AppDelegate.swift:5)
    32  dyld_sim                      	       0x10ab1ef21 start_sim + 10
    33  dyld                          	       0x20242c52e start + 462
    
    Thread 1:: com.apple.rosetta.exceptionserver
    0   ???                           	    0x7ff7ffc79944 ???
    1   ???                           	    0x7ff7ffc921f0 ???
    
    Thread 2:
    0   ???                           	    0x7ff7ffc97814 ???
    
    Thread 3::  Dispatch queue: com.apple.opengl.cvmDoWork
    0   ???                           	    0x7ff7ffc92884 ???
    1   <translation info unavailable>	       0x108ab7790 ???
    2   ???                           	               0x2 ???
    3   libLLVMContainer.dylib        	       0x11a07f74e llvm::TargetLowering::TargetLowering(llvm::TargetMachine const&, llvm::TargetLoweringObjectFile const*) + 14
    4   libLLVMContainer.dylib        	       0x119eb2eab llvm::X86TargetLowering::X86TargetLowering(llvm::X86TargetMachine&) + 347
    5   libLLVMContainer.dylib        	       0x119f425ec llvm::X86Subtarget::X86Subtarget(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, llvm::X86TargetMachine&, unsigned int) + 1212
    6   libLLVMContainer.dylib        	       0x119f42e1f llvm::X86TargetMachine::X86TargetMachine(llvm::Target const&, llvm::StringRef, llvm::StringRef, llvm::StringRef, llvm::TargetOptions const&, llvm::Reloc::Model, llvm::CodeModel::Model, llvm::CodeGenOpt::Level) + 687
    7   libLLVMContainer.dylib        	       0x119f432cd llvm::RegisterTargetMachine<llvm::X86TargetMachine>::Allocator(llvm::Target const&, llvm::StringRef, llvm::StringRef, llvm::StringRef, llvm::TargetOptions const&, llvm::Reloc::Model, llvm::CodeModel::Model, llvm::CodeGenOpt::Level) + 109
    8   libLLVMContainer.dylib        	       0x119e5beb0 llvm::EngineBuilder::selectTarget(llvm::Triple const&, llvm::StringRef, llvm::StringRef, llvm::SmallVectorImpl<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&) + 864
    9   libLLVMContainer.dylib        	       0x119e5bb30 llvm::EngineBuilder::selectTarget() + 192
    10  libGLVMPlugin.dylib           	       0x1403a1069 cvmsPluginServiceInitialize + 893
    11  libCoreVMClient.dylib         	       0x1134b215e cvmsCompCreateObjects + 394
    12  libCoreVMClient.dylib         	       0x1134b5dc1 cvmsCreateCompilerService + 85
    13  libCoreVMClient.dylib         	       0x1134b6f8c cvmsServerElementBuild + 1539
    14  libCoreVMClient.dylib         	       0x1134b2c82 cvms_element_build_from_source + 118
    15  libCVMSPluginSupport.dylib    	       0x112c0a776 cvm_deferred_build_modular(void*) + 413
    16  libdispatch.dylib             	       0x10b441b25 _dispatch_client_callout + 8
    17  libdispatch.dylib             	       0x10b4480df _dispatch_lane_serial_drain + 753
    18  libdispatch.dylib             	       0x10b448cc1 _dispatch_lane_invoke + 400
    19  libdispatch.dylib             	       0x10b45397b _dispatch_workloop_worker_thread + 779
    20  libsystem_pthread.dylib       	       0x10c77afd0 _pthread_wqthread + 326
    21  libsystem_pthread.dylib       	       0x10c779f57 start_wqthread + 15
    
    
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions