1

So, I haven't been able to figure this out yet, because when I pause execution... Xcode doesn't really show what's going on:

Xcode hang/freeze analysis

This freeze happens when I scroll a very long UITableView around in the center of its scrollable area constantly, so that it's constantly reusing cells. I think that perhaps there is something not being retained for a dispatch block that might happen there, but I'm not yet sure since no data is displayed using the standard debugger and its a fairly complex view. (reference: https://stackoverflow.com/a/23501382/963901 )

I'm going to attempt some manual diagnosis here, but is there any other way of approaching this with Instruments or something, perhaps?

Community
  • 1
  • 1
Ben Guild
  • 4,881
  • 7
  • 34
  • 60
  • Step 1: disable the setting in Xcode's debug navigator pane that hides intermediate stack frames from you (it's one of the buttons at the bottom right of the pane that shows the stack trace). Step 2: look at the newly-revealed portion of the backtrace to see what code is blocking on the semaphore. Step 3: look at the other threads in your program to see which appear to be doing work related to the code discovered in 2. – bdash Jul 22 '16 at 05:15
  • Thanks! Do you want to post that as the solution? – Ben Guild Jul 30 '16 at 08:05

1 Answers1

5

To investigate this sort of problem I'd suggest the following:

  1. Disable the setting in Xcode's debug navigator pane that hides intermediate stack frames from you. It's one of the buttons at the bottom right of the pane that shows the stack trace.

  2. Look at the newly-revealed portion of the backtrace to see what code is blocking on the semaphore.

  3. Look at the other threads in your program to see which appear to be doing work related to the code discovered in step 2.

bdash
  • 18,110
  • 1
  • 59
  • 91