0

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;
}
The Lazy Coder
  • 11,560
  • 4
  • 51
  • 69
  • 1
    are you trying to update a UI element on a background thread? – Jesse Gumpo Jul 12 '12 at 18:05
  • 1
    Did you checked http://stackoverflow.com/questions/1371346/wait-fences-failed-to-receive-reply-10004003 http://stackoverflow.com/questions/8032987/why-do-i-get-wait-fences-failed-to-receive-reply-for-this-code http://stackoverflow.com/questions/1202300/iphone-sdk-3-0-wait-fences-failed-to-receive-reply-10004003 http://stackoverflow.com/questions/4241894/wait-fences-failed-to-receive-reply-10004003-error-uialert-without-uitextfie – msk Jul 12 '12 at 18:06
  • I did check out all of those. I do not believe that I am doing any animations but I have two competing methods that are being dispatched on the high priority thread. I comment one or the other and I still get the error, commenting both makes the error go away. I am working on all the threading sections to convert them to check and dispatch only if needed. But I thought dispatch_async put them on the queue I expected them to run in succession. – The Lazy Coder Jul 12 '12 at 18:37
  • I have removed the UI code from my startup, and I have modified all the dispatches to use the code provided above. The error still pops up 3 out of 4 times I run the app – The Lazy Coder Jul 12 '12 at 23:44

2 Answers2

1

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.

Husker Jeff
  • 857
  • 1
  • 5
  • 6
0

I'd look for missing calls to super's view(Did/Will)Appear. If these are omitted you will see "wait fences", whatever that means.

troppoli
  • 558
  • 6
  • 13
  • I checked for this as well. All my calls call their super and all of the UI editing ones are either in did appear or are on a dispatch_async to main, What i am really looking for is more info on this error. I am in the progress of converting all my thread calls. hoping that will help. (only dispatch when your not on the thread requested, that sort of thing) – The Lazy Coder Jul 12 '12 at 18:57