Reputation: 4289
TESTPRO_TEST[830] has active assertions beyond permitted time:
{(
<BKProcessAssertion: 0x1fd48670> identifier: UIKitBackgroundCompletionTask process: TESTPRO_TEST[830] permittedBackgroundDuration: 600.000000 reason: finishTask owner pid:830 preventSuspend preventIdleSleep ,
<BKProcessAssertion: 0x2083f190> identifier: UIKitBackgroundCompletionTask process: TESTPRO_TEST[830] permittedBackgroundDuration: 600.000000 reason: finishTask owner pid:830 preventSuspend preventIdleSleep
)}
<Warning>: Forcing crash report of DSC_TEST[830]...
<Warning>: Finished crash reporting.
[830] has active assertions beyond permitted time:
{(
<BKProcessAssertion: 0x1fd48670> identifier: UIKitBackgroundCompletionTask process: [830] permittedBackgroundDuration: 600.000000 reason: finishTask owner pid:830 preventSuspend preventIdleSleep
)}
<Warning>: Forcing crash report of [830]...
<Error>: Multiple simulate crash requests for pid 830
<Warning>: Finished crash reporting.
<Warning>: pid_suspend failed for [830]: Unknown error: -1, Unknown error: -1
com.apple.launchd[1] (UIKitApplication:com.testPro.Test[0x4aff][830]) <Notice>: (UIKitApplication:com.testPro.Test[0x4aff]) Exited: Killed: 9
<Warning>: Application 'UIKitApplication:com.testPro.Test[0x4aff]' exited abnormally with signal 9: Killed: 9
�<Debug>: launchd[869] Builtin profile: container (sandbox)
<Debug>: launchd[869] Container: /private/var/mobile/Applications/3CF1EEC9-B6EF-45EA-999D-EBB9C02106EE (sandbox)
<Error>: Not saving crash log because we have reached the limit for logs to store on disk. Sync or otherwise clear logs from /var/mobile/Library/Logs/CrashReporter to save new logs.
<Error>: Could not save crash report to disk!
When application enters background, I have added the code
- (void) applicationDidEnterBackground:(UIApplication *) application
{
[UIApplication sharedApplication].applicationIconBadgeNumber = 0;
UIBackgroundTaskIdentifier bgTask = 0;
UIApplication *app = [UIApplication sharedApplication];
bgTask = [app beginBackgroundTaskWithExpirationHandler: ^{
[app endBackgroundTask:bgTask];
}];
}
The crash occurs when the application enters background.Can anyone help me out to fix this crash?
Upvotes: 2
Views: 5724
Reputation: 9935
The reason is obvious - it is pointed in log - your time has expired.
Applications running background tasks have a finite amount of time in which to run them. (You can find out how much time is available using the backgroundTimeRemaining property.) If you do not call endBackgroundTask: for each task before time expires, the system kills the application.
I don't think that you should call this method in applicationDidEnterBackground:
try to move it to appropriate place(where you start your work). You use it to wrap long playing processes that might also work in bkg. Do not judge my answer severely, this is just my surmise that may become true.
P.S. Here's good explanation of What are beginBackgroundTaskWithExpirationHandler and endBackgroundTask methods
Upvotes: 2