Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Xcode 9 Beta] Main thread assertion improperly flags custom category methods. #345

Closed
appleguy opened this issue Jun 10, 2017 · 2 comments
Assignees

Comments

@appleguy
Copy link
Member

Even though these methods are threadsafe, Apple's new main thread guard is flagging them. We should file a Radar or otherwise ensure that there is a workaround for developers who know what they're doing with threads :)

pasted image at 2017_06_08 11_59 pm

@WymzeeLabs
Copy link
Contributor

Glad to see these are red herrings.

@WymzeeLabs
Copy link
Contributor

WymzeeLabs commented Jun 11, 2017

I am seeing this however:

* thread #3, queue = 'com.apple.root.default-qos', stop reason = breakpoint 1.1
    frame #0: 0x0000000103368514 Sample`::ASViewToDisplayNode(view=0x00007f96b1846200) at ASDisplayNodeExtras.mm:75
    frame #1: 0x0000000103425dac Sample`::-[ASTableView tableNode](self=0x00007f96b1846200, _cmd="tableNode") at ASTableView.mm:546
  * frame #2: 0x000000010342f917 Sample`::__34-[ASTableView _beginBatchFetching]_block_invoke((null)=<unavailable>) at ASTableView.mm:1344
    frame #3: 0x000000010914e6dd libdispatch.dylib`_dispatch_call_block_and_release + 12
    frame #4: 0x000000010914f6c8 libdispatch.dylib`_dispatch_client_callout + 8
    frame #5: 0x00000001091547b6 libdispatch.dylib`_dispatch_queue_override_invoke + 1534
    frame #6: 0x000000010915bef4 libdispatch.dylib`_dispatch_root_queue_drain + 783
    frame #7: 0x000000010915bb82 libdispatch.dylib`_dispatch_worker_thread4 + 54
    frame #8: 0x00000001095a25a2 libsystem_pthread.dylib`_pthread_wqthread + 1299
    frame #9: 0x00000001095a207d libsystem_pthread.dylib`start_wqthread + 13

which stems from this code:

[_batchContext beginBatchFetching];
  if (_asyncDelegateFlags.tableNodeWillBeginBatchFetch) {
    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
      GET_TABLENODE_OR_RETURN(tableNode, (void)0);
      [_asyncDelegate tableNode:tableNode willBeginBatchFetchWithContext:_batchContext];
    });
  } else if (_asyncDelegateFlags.tableViewWillBeginBatchFetch) {
    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
      [_asyncDelegate tableView:self willBeginBatchFetchWithContext:_batchContext];
#pragma clang diagnostic pop
    });
  }

bug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants