Open Bogdan-Belogurov opened 1 month ago
@Bogdan-Belogurov Hard to say from the stack traces alone, could you put together a sample project exhibiting the crash? It would help a great deal if we could reproduce it on our end.
@evil159 Thanks for the reply 🙏🏿 It's hard to reproduce because I can't figure out the steps but I'll try 🤔
I've also been getting crashes coming from various places in MetalView.draw
. Our project also updates geojson source frequently (in order to animate some symbol and model layers). Sometimes the app crashes, sometimes the app freezes without crashing. It's been hard to reproduce reliably for me, as it seems like whatever's causing these crashes is triggered somewhere upstream, but will try to isolate as well. One thing to note in our case, is that the crashes occur usually when we are animating the camera with a camera animator.
Here are a few of the stack traces from when the app was terminated when it became unresponsive.
Same here. Sentry reports MXCPUException, crashes in onRender (iOS Version:17.5.1, iPhone XS)
class MetalView: MTKView, CoreMetalView { private class DelegateImpl: NSObject, MTKViewDelegate { var onRender: (() -> Void)? func mtkView(_ view: MTKView, drawableSizeWillChange size: CGSize) {} func draw(in view: MTKView) { onRender?() } }
Thanks for all your hard work!
Environment
Xcode version: 15.3
iOS version: 17.5.1/17.4.1/17.4/17.3.1/17.3.0/17.2.1/16.7.7/16.6.1/16.3.1
Devices affected: iPhone/iPad/Simulator
Maps SDK Version: 10.17.0
Observed behavior and steps to reproduce
Just staying on the map, and sometimes this crash happens. I have
updateGeoJSONSource
andupdateLayer
called frequently to update the position and appearance of the layer. Maybe you know what is wrong and can help me understand the cause.Stack traces:
1
```bash Crashed: com.apple.main-thread 0 MapboxCoreMaps 0x2b0ee0 mbgl::RenderSymbolLayer::render(mbgl::PaintParameters&) + 2500 1 MapboxCoreMaps 0x2e9cd8 mbgl::(anonymous namespace)::LayerRenderItemImpl::render(mbgl::PaintParameters&) const + 92 2 MapboxCoreMaps 0x303cd0 mbgl::Renderer::Impl::render(mbgl::RenderTree const&) + 28280 3 MapboxCoreMaps 0x2f86f0 mbgl::Renderer::render(std::__1::shared_ptr const&) + 604
4 MapboxCoreMaps 0x79130 mapbox::maps::MapImpl::Impl::render() + 400
5 MapboxCoreMaps 0x74270 -[MBMMetalViewDelegate drawInMTKView:] + 536
6 MetalKit 0x3224 -[MTKView draw] + 160
7 App 0xd3282c MapView.updateFromDisplayLink(displayLink:) + 631 (MapView.swift:631)
8 App 0xd33354 closure #1 in MapView.didMoveToWindow() + 667 (MapView.swift:667)
9 App 0xd1d93c ForwardingDisplayLinkTarget.update(with:) + 12 (ForwardingDispalyLinkTarget.swift:12)
10 App 0xd1d988 @objc ForwardingDisplayLinkTarget.update(with:) + 4347599240 (:4347599240)
11 QuartzCore 0x2fd50 CA::Display::DisplayLinkItem::dispatch_(CA::SignPost::Interval<(CA::SignPost::CAEventCode)835322056>&) + 48
12 QuartzCore 0x32f30 CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 868
13 QuartzCore 0xb1654 CA::Display::DisplayLink::dispatch_deferred_display_links(unsigned int) + 352
14 UIKitCore 0xaad78 _UIUpdateSequenceRun + 84
15 UIKitCore 0xaa468 schedulerStepScheduledMainSection + 144
16 UIKitCore 0xaa524 runloopSourceCallback + 92
17 CoreFoundation 0x3762c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
18 CoreFoundation 0x368a8 __CFRunLoopDoSource0 + 176
19 CoreFoundation 0x35058 __CFRunLoopDoSources0 + 244
20 CoreFoundation 0x33d88 __CFRunLoopRun + 828
21 CoreFoundation 0x33968 CFRunLoopRunSpecific + 608
22 GraphicsServices 0x34e0 GSEventRunModal + 164
23 UIKitCore 0x22aedc -[UIApplication _run] + 888
24 UIKitCore 0x22a518 UIApplicationMain + 340
25 App 0x806c main + 24 (main.swift:24)
```
2
```bash Crashed: com.apple.main-thread 0 MapboxCoreMaps 0x1adea0 mbgl::UpdateParameters::~UpdateParameters() + 236 1 MapboxCoreMaps 0x4eb32c mbgl::Placement::reset(std::__1::shared_ptr, mbgl::Placement const*) + 96
2 MapboxCoreMaps 0x4f8c70 mbgl::PlacementController::updatePlacement(std::__1::shared_ptr) + 120
3 MapboxCoreMaps 0x2e0b20 mbgl::RenderOrchestrator::createRenderTree(std::__1::shared_ptr const&) + 58852
4 MapboxCoreMaps 0x2f855c mbgl::Renderer::render(std::__1::shared_ptr const&) + 200
5 MapboxCoreMaps 0x79130 mapbox::maps::MapImpl::Impl::render() + 400
6 MapboxCoreMaps 0x74270 -[MBMMetalViewDelegate drawInMTKView:] + 536
7 MetalKit 0x3224 -[MTKView draw] + 160
8 App 0xd3282c MapView.updateFromDisplayLink(displayLink:) + 631 (MapView.swift:631)
9 App 0xd33354 closure #1 in MapView.didMoveToWindow() + 667 (MapView.swift:667)
10 App 0xd1d93c ForwardingDisplayLinkTarget.update(with:) + 12 (ForwardingDispalyLinkTarget.swift:12)
11 App 0xd1d988 @objc ForwardingDisplayLinkTarget.update(with:) + 4324645256 (:4324645256)
12 QuartzCore 0x2fd50 CA::Display::DisplayLinkItem::dispatch_(CA::SignPost::Interval<(CA::SignPost::CAEventCode)835322056>&) + 48
13 QuartzCore 0x32f30 CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 868
14 QuartzCore 0xb1654 CA::Display::DisplayLink::dispatch_deferred_display_links(unsigned int) + 352
15 UIKitCore 0xaad78 _UIUpdateSequenceRun + 84
16 UIKitCore 0xaa468 schedulerStepScheduledMainSection + 144
17 UIKitCore 0xaa524 runloopSourceCallback + 92
18 CoreFoundation 0x3762c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
19 CoreFoundation 0x368a8 __CFRunLoopDoSource0 + 176
20 CoreFoundation 0x35058 __CFRunLoopDoSources0 + 244
21 CoreFoundation 0x33d88 __CFRunLoopRun + 828
22 CoreFoundation 0x33968 CFRunLoopRunSpecific + 608
23 GraphicsServices 0x34e0 GSEventRunModal + 164
24 UIKitCore 0x22aedc -[UIApplication _run] + 888
25 UIKitCore 0x22a518 UIApplicationMain + 340
26 App 0x806c main + 24 (main.swift:24)
```
3
```bash Crashed: com.apple.main-thread 0 MapboxCoreMaps 0x3e2bd8 std::__1::__tree, std::__1::__map_value_compare, std::__1::less, true>, std::__1::allocator>>::destroy(std::__1::__tree_node, void*>*) + 24
1 MapboxCoreMaps 0x3e2be0 std::__1::__tree, std::__1::__map_value_compare, std::__1::less, true>, std::__1::allocator>>::destroy(std::__1::__tree_node, void*>*) + 32
2 MapboxCoreMaps 0x3e2be0 std::__1::__tree, std::__1::__map_value_compare, std::__1::less, true>, std::__1::allocator>>::destroy(std::__1::__tree_node, void*>*) + 32
3 MapboxCoreMaps 0x3e2be0 std::__1::__tree, std::__1::__map_value_compare, std::__1::less, true>, std::__1::allocator>>::destroy(std::__1::__tree_node, void*>*) + 32
4 MapboxCoreMaps 0x3e2bec std::__1::__tree, std::__1::__map_value_compare, std::__1::less, true>, std::__1::allocator>>::destroy(std::__1::__tree_node, void*>*) + 44
5 MapboxCoreMaps 0x4b43a8 std::__1::__shared_ptr_pointer::__shared_ptr_default_delete, std::__1::allocator>::__on_zero_shared() + 124
6 MapboxCoreMaps 0x4abd10 std::__1::__shared_ptr_emplace>::__on_zero_shared() + 124
7 MapboxCoreMaps 0x2d21c8 std::__1::__shared_ptr_emplace, std::__1::allocator>>, std::__1::allocator, std::__1::allocator>>>>::__on_zero_shared() + 108
8 MapboxCoreMaps 0x1ade90 mbgl::UpdateParameters::~UpdateParameters() + 220
9 MapboxCoreMaps 0x4eb32c mbgl::Placement::reset(std::__1::shared_ptr, mbgl::Placement const*) + 96
10 MapboxCoreMaps 0x4f8c70 mbgl::PlacementController::updatePlacement(std::__1::shared_ptr) + 120
11 MapboxCoreMaps 0x2e0b20 mbgl::RenderOrchestrator::createRenderTree(std::__1::shared_ptr const&) + 58852
12 MapboxCoreMaps 0x2f855c mbgl::Renderer::render(std::__1::shared_ptr const&) + 200
13 MapboxCoreMaps 0x79130 mapbox::maps::MapImpl::Impl::render() + 400
14 MapboxCoreMaps 0x74270 -[MBMMetalViewDelegate drawInMTKView:] + 536
15 MetalKit 0x74b4 -[MTKView draw] + 160
16 App 0xd3282c MapView.updateFromDisplayLink(displayLink:) + 631 (MapView.swift:631)
17 App 0xd33354 closure #1 in MapView.didMoveToWindow() + 667 (MapView.swift:667)
18 App 0xd1d93c ForwardingDisplayLinkTarget.update(with:) + 12 (ForwardingDispalyLinkTarget.swift:12)
19 App 0xd1d988 @objc ForwardingDisplayLinkTarget.update(with:) + 4316404104 (:4316404104)
20 QuartzCore 0xd0ecc CA::Display::DisplayLinkItem::dispatch_(CA::SignPost::Interval<(CA::SignPost::CAEventCode)835322056>&) + 48
21 QuartzCore 0xcf230 CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 876
22 QuartzCore 0xcedd0 CA::Display::DisplayLink::dispatch_deferred_display_links(unsigned int) + 352
23 UIKitCore 0xb776c _UIUpdateSequenceRun + 84
24 UIKitCore 0xb73b0 schedulerStepScheduledMainSection + 172
25 UIKitCore 0xb8254 runloopSourceCallback + 92
26 CoreFoundation 0x56834 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
27 CoreFoundation 0x567c8 __CFRunLoopDoSource0 + 176
28 CoreFoundation 0x54298 __CFRunLoopDoSources0 + 244
29 CoreFoundation 0x53484 __CFRunLoopRun + 828
30 CoreFoundation 0x52cd8 CFRunLoopRunSpecific + 608
31 GraphicsServices 0x11a8 GSEventRunModal + 164
32 UIKitCore 0x40a90c -[UIApplication _run] + 888
33 UIKitCore 0x4be9d0 UIApplicationMain + 340
34 App 0x806c main + 24 (main.swift:24)
```
Expected behavior
No crash