App is crashing on only iOS 13 in the background mode

The app is crashing only on iOS 13 and when I saw the detailed report, Reports are mentioning the app was in the background when it was crashed. No reference of the line of code mentioned in the crash logs where I can find the line which is causing the crash.


Crashed: com.apple.main-thread

EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000f5e5f9c3c


Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x1aed79d10 objc_opt_respondsToSelector + 20
1 Foundation 0x1af423588 _NSDescriptionWithStringProxyFunc + 56
2 CoreFoundation 0x1aefdc534 __CFStringAppendFormatCore + 7960
3 CoreFoundation 0x1aefddb10 _CFStringCreateWithFormatAndArgumentsAux2 + 152
4 Foundation 0x1af2f63c4 +[NSString stringWithFormat:] + 72
5 UIKitCore 0x1b30d95d8 -[_UIBackgroundTaskInfo description] + 144
6 UIKitCore 0x1b30e302c _fireBackgroundExpirationHandlers + 1068
7 UIKitCore 0x1b30e2b2c -[UIApplication workspaceNoteAssertionExpirationImminent:] + 136
8 FrontBoardServices 0x1b41adc50 __45-[FBSUIApplicationWorkspaceShim setDelegate:]_block_invoke_3 + 48
9 libdispatch.dylib 0x1aed01524 _dispatch_client_callout + 16
10 libdispatch.dylib 0x1aecaa434 _dispatch_block_invoke_direct$VARIANT$mp + 224
11 FrontBoardServices 0x1b41fe440 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 40
12 FrontBoardServices 0x1b41fe10c -[FBSSerialQueue _queue_performNextIfPossible] + 404
13 FrontBoardServices 0x1b41fe634 -[FBSSerialQueue _performNextFromRunLoopSource] + 28
14 CoreFoundation 0x1aefb9b64 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
15 CoreFoundation 0x1aefb9abc __CFRunLoopDoSource0 + 80
16 CoreFoundation 0x1aefb9244 __CFRunLoopDoSources0 + 184
17 CoreFoundation 0x1aefb4274 __CFRunLoopRun + 788
18 CoreFoundation 0x1aefb3c34 CFRunLoopRunSpecific + 424
19 GraphicsServices 0x1b90fd38c GSEventRunModal + 160
20 UIKitCore 0x1b30e622c UIApplicationMain + 1932
21 MagicBox Learning 0x104644058 main + 14 (main.m:14)
22 libdyld.dylib 0x1aee3b800 start + 4

Replies

This looks like a memory management problem. In frame 6 the system is calling background task expiration handlers, which calls

-description
(frame 5) to do some logging. Frames 4 through 1 are standard description-y stuff, and frame 0 is a bad memory reference. The only way this can happen is if you have a memory management issue, with the most likely issue being that something got deallocated out from underneath a
UIApplication
background task.

As a first step I recommend that you run the standard memory debugging tools to see if those can make the problem more reproducible.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"