Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could someone explain 'CoreAnimation: timed out fence' log message?

I received a report of a crash with our iPad application, with a log message attached. The last couple of lines of the log message are as follows:

Aug 21 08:58:51 2TesterPad backboardd[26] <Warning>: CoreAnimation: timed out fence 25993
Aug 21 08:58:51 2TesterPad backboardd[26] <Warning>: CoreAnimation: updates deferred for too long
Aug 21 08:58:52 2TesterPad AppName[2428] <Warning>: CoreAnimation: failed to receive fence reply: 10004003

Can anyone tell me what these log messages mean please? I've been unable to find any good information about this online.

like image 259
Will Bolam Avatar asked Aug 21 '13 18:08

Will Bolam


2 Answers

It typically means that core animation operations are queued, but have been pending for too long and have timed out.

A few things to check:

  • Ensure you are calling the super method on any -viewDidAppear and -viewWillAppear
  • Ensure you are not performing animations before the view is presented via -viewDidAppear
  • Check you are only interacting with the UI on the main thread. I've seen issues with wait fence message when displaying a UIAlertView when the relevant code was executed on a background thread. You can make sure by putting your code in a block and sending it to the main thread, example below
  • This can happen if you have a UIScollView that has a lot of subviews and you animate the UIScrollView. In this case it will animate all of its subviews, even if those subviews aren't on screen. See this answer: https://stackoverflow.com/a/10938889/257550 . One solution to fix this would be to redesign the view to use a UITableView which ensures that only the subviews in the visible cells are animated.

    dispatch_async(dispatch_get_main_queue(), ^{
    
        UIAlertView *alert = 
           [[UIAlertView alloc] initWithTitle:@"title", 
                                       mssage:@"message"
                                     delegate:nil 
                            cancelButtonTitle:@"OK"
                            otherButtonTitles:nil];
    
        [alert show];
    });
    
like image 110
memmons Avatar answered Sep 27 '22 18:09

memmons


First I would like to thank Michael G.Emmons for the answer. That put me in right direction.

The problem was, I was calling the service in(listView) viewWillApear, and in (detailsView) I was saving the details (service was called),dismissAlert had an animation, when coming back to the list Screen(again) the animation was called. There were piled up for somereason and throwing this warning. The device use to hang without any log message in Xcode console and it was hard to debug.

It was working fine with iOS (7), had problems with iOS 8, in iPhone 6 Simulator and above.

I had a similar issue, my console logs were: : CoreAnimation: timed out fence e025 : CoreAnimation: failed to receive fence reply: 10004003

Solution: I moved the code(service calls) to appropriately from viewWillAppear to viewDidAppear and removed the unnecessary (animations).

It solved my problem. I hope it helps some.

like image 25
Santosh Avatar answered Sep 27 '22 18:09

Santosh