Terminated due signal 9 after iOS 13

I developed an app that record audio in background. After iOS update to version 13, the app crash and the follow message is show in terminal "terminated due to signal 9". I know it means that the app was terminated by a sigkill signal and maybe it's because of memory pressure and etc. But I want to know why it is happening now. What can I do to solve this problem?

Replies

After iOS update to version 13, the app crash and the follow message is show in terminal "terminated due to signal 9".

Does this generate a crash report?

Share and Enjoy

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

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

Thanks for your reply

I discovered that this crash happens only in background, when I turn off the screen.

Absolutely after when I press the turn off button, a message is shown "Can't end BackgroundTask: no background task exists with identifier 3 (0x3), or it may have already been ended. Break in UIApplicationEndBackgroundTaskError() to debug."


The app keeps working normally, but about 30 seconds later the crash happens and the only message shown is "Message from debugger: Terminated due to signal 9"

Those are interesting factoids, suggesting that your code (or possible some part of the OS) is failing to track

UIApplication
background tasks properly, resulting in a ‘leak’ of such a task. That keeps your app running for 30 seconds, until the background task expires, at which point the app gets killed by the watchdog.

See UIApplication Background Task Notes post for more info on this API.

Share and Enjoy

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

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

Did you ever resolve this issue? I am having exactly the same problem. [Edit: after many hours of debuggling I found that the problem related to a memory leak related to a UI element that was animating during recording of audio. Entirely my fault.]