Search code examples
iosmultithreadingwait-fences

how do I debug a wait_fences error


wait_fences: failed to receive reply: 10004003

I continue to get this error. It happens when my app starts up. How would I debug this issue. Is there some way I can watch the wait_fences and see what is going on there. Is there some way to see what threads are blocking what ?

It feels like this error is nothing but a theading black hole with no tools or info getting into or coming out of the void.

Anyone with tips on debugging this error would be greatly appreciated.

New

I have now changed my threading, All threading calls go through this method set to do all their dispatches

NOTE: Also I wish you guys would not vote to close my question just because you have seen another question about this problem. There is no real information about this error. I need to know what causes this error and/or how to debug it. not the common "add the super calls to your viewDidAppear and the such. If those helped, I would not have asked this question.

+ (void) ensureDispatchOfBlock:(dispatch_block_t) block onQueue:(dispatch_queue_t) queue  async:(BOOL) async{
    if (dispatch_get_current_queue() == queue){
        block();
    }
    else {
        if (async){
            dispatch_async(queue, block);
        }
        else {
            dispatch_sync(queue, block);
        }
    }
}

+ (void) ensureDispatchOnMainThread:(dispatch_block_t) block async:(BOOL) async{
    [self ensureDispatchOfBlock:block onQueue:dispatch_get_main_queue() async:async];
}

+ (BOOL) addBlock:(dispatch_block_t) block toQueue:(dispatch_queue_t) queue async:(BOOL) async {
    if (!async && dispatch_get_current_queue() == queue){
        return NO;
    }
    if (async){
        dispatch_async(queue, block);
    }
    else {
        dispatch_sync(queue, block);
    }
    return YES;
}

Solution

  • That error usually comes up as a result of trying to animate something that isn't visible on-screen. If it happens on launch, I'd guess that you're trying to start an animation in viewDidLoad.