Open jumbopilot opened 5 months ago
Hi @jumbopilot --
Thanks for sharing this report. I was able to investigate today for some time, but I have not been able to replicate this crash. Could you share a simple project which replicates the issue?
I am also seeing this crash occasionally, though with WatchdogVisibility: Background
.
The way this issue presents itself is that when backgrounding the app then reopening it after a while, new tiles do not load. After force closing the app and re-opening, the map tiles load as expected and there is a popup that the app crashed (sharing the crash report directly via the popup doesn't include the below crash report, but it can be found in Settings > Analytics & Improvements > Analytics Data.
Hey, @KaylaBrady thanks for sharing the crash log, which version of the SDK do you use?
@aleksproger this was using 11.3.0. I'm working on an upgrade to 11.7.0 to see if that will resolve the issue. With that upgrade I'm working through some new maps-core warnings after backgrounding ([Warning, maps-core]: {}[Style]: Required image 'image-name' is missing and it will not be rendered. Subscribe to StyleImageMissing event to be aware of the required missing images and add them by calling addStyleImage().
). These images were previously retained after backgrounding, I'm not sure if this is related to the CleanupManager. I expect to be able to resolve these warnings but am wondering if there is a known related change that explains this behavior - nothing jumped out as me in the changelogs, and I'm having trouble finding documentation about the CleanupManager.
@KaylaBrady I suspect this problem happens when you delete annotation with image? If yes, then it's a known problem which actually shouldn't affect anything this is just incorrect log. If it's not your case please describe at which condition it happens. CleanupManager is basically an internal object and hence not documented and the warning is not related to this object.
@aleksproger this is happening occasionally after moving the app into the background for images that are used by a layer. The layer's source is not deleted when backgrounding.
We are are also noticing onStyleLoaded
is being triggered after backgrounding the app which is we were not expecting. This is happening on 11.3.0 and 11.7.0 though, and may not be related to this original issue.
Environment
Observed behavior and steps to reproduce
Run mapbox map and dismiss/display the map multiple times over 30 minutes using same SwiftUI view.
Observed: crash logfile from device Exception Type: EXC_CRASH (SIGKILL) Exception Codes: 0x0000000000000000, 0x0000000000000000 Termination Reason: FRONTBOARD 2343432205 <RBSTerminateContext| domain:10 code:0x8BADF00D explanation:[app:10815] failed to terminate gracefully after 5.0s
ProcessVisibility: Unknown
ProcessState: Running
WatchdogEvent: process-exit
WatchdogVisibility: Foreground
WatchdogCPUStatistics: (
"Elapsed total CPU time (seconds): 18.700 (user 14.430, system 4.270), 61% CPU",
"Elapsed application CPU time (seconds): 5.393, 17% CPU"
) reportType:CrashLog maxTerminationResistance:Interactive>
Triggered by Thread: 0
Kernel Triage: VM - (arg = 0x3) mach_vm_allocate_kernel failed within call to vm_map_enter VM - (arg = 0x3) mach_vm_allocate_kernel failed within call to vm_map_enter VM - (arg = 0x3) mach_vm_allocate_kernel failed within call to vm_map_enter VM - (arg = 0x3) mach_vm_allocate_kernel failed within call to vm_map_enter
Thread 0 name: Dispatch queue: com.apple.main-thread Thread 0 Crashed: 0 libsystem_kernel.dylib 0x1d3c651cc psynch_cvwait + 8 1 libsystem_pthread.dylib 0x1e7a126e4 _pthread_cond_wait + 1228 2 libc++.1.dylib 0x19b2a5504 std::__1::condition_variable::wait(std::1::unique_lock&) + 28
3 libc++.1.dylib 0x19b2a8ea4 std::1::assoc_sub_state::sub_wait(std::__1::unique_lock<std::1::mutex>&) + 56
4 libc++.1.dylib 0x19b2a8df4 std::1::assoc_sub_state::copy() + 56
5 libc++.1.dylib 0x19b2a9198 std::1::future::get() + 32
6 MapboxCommon 0x1049cfaf0 0x104860000 + 1506032
7 MapboxCommon 0x1049cf2bc 0x104860000 + 1503932
8 MapboxCommon 0x1049d0ed8 0x104860000 + 1511128
9 MapboxCommon 0x1049ccef0 0x104860000 + 1494768
10 MapboxCommon 0x1048bee20 mapbox::common::CleanupManager::cleanup() + 1364
11 CoreFoundation 0x18aed17b8 CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER + 128
12 CoreFoundation 0x18aed16e8 _CFXRegistrationPost_block_invoke + 88
13 CoreFoundation 0x18aed1630 _CFXRegistrationPost + 440
14 CoreFoundation 0x18aecfbf8 _CFXNotificationPost + 728
15 Foundation 0x189d5e574 -[NSNotificationCenter postNotificationName:object:userInfo:] + 92
16 UIKitCore 0x18dfc646c -[UIApplication _terminateWithStatus:] + 232
17 UIKitCore 0x18d29f630 -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] + 112
18 UIKitCore 0x18d8ac134 -[_UISceneLifecycleMultiplexer forceExitWithTransitionContext:scene:] + 164
19 UIKitCore 0x18dfc1b34 -[UIApplication workspaceShouldExit:withTransitionContext:] + 164
20 FrontBoardServices 0x1a3ba03e8 63-[FBSWorkspaceScenesClient willTerminateWithTransitionContext:]_block_invoke_2 + 72
21 FrontBoardServices 0x1a3b686cc -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 168
22 FrontBoardServices 0x1a3ba0388 63-[FBSWorkspaceScenesClient willTerminateWithTransitionContext:]_block_invoke + 128
23 libdispatch.dylib 0x1044c27bc _dispatch_client_callout + 20
24 libdispatch.dylib 0x1044c61f0 _dispatch_block_invoke_direct + 300
25 FrontBoardServices 0x1a3b69d58 FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK + 52
26 FrontBoardServices 0x1a3b69cd8 -[FBSMainRunLoopSerialQueue _targetQueue_performNextIfPossible] + 240
27 FrontBoardServices 0x1a3b69bb0 -[FBSMainRunLoopSerialQueue _performNextFromRunLoopSource] + 28
28 CoreFoundation 0x18aed6874 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 28
29 CoreFoundation 0x18aed6808 CFRunLoopDoSource0 + 176
30 CoreFoundation 0x18aed4338 CFRunLoopDoSources0 + 340
31 CoreFoundation 0x18aed34c4 __CFRunLoopRun + 828
32 CoreFoundation 0x18aed2d18 CFRunLoopRunSpecific + 608
33 GraphicsServices 0x1cfa461a8 GSEventRunModal + 164
34 UIKitCore 0x18d50f058 -[UIApplication _run] + 888
35 UIKitCore 0x18d5c304c UIApplicationMain + 340
36 SwiftUI 0x18f0babd4 0x18ecc8000 + 4139988
37 SwiftUI 0x18f06735c 0x18ecc8000 + 3797852
38 SwiftUI 0x18f073118 0x18ecc8000 + 3846424
39 AppName 0x10117075c static AppName.$main() + 40
40 AppName 0x101174548 main + 12
41 dyld 0x1ae917e4c start + 2240
Expected behavior
No crash in MapboxCommon mapbox::common::CleanupManager::cleanup()
Notes / preliminary analysis
Device CPU is already loaded at ~50% by the whole app operation.
Additional links and references
The app makes use of multiple