Good day. I'm having problems debugging hangs. Watched the video WWDC Analyze hangs with Instruments. Apparently the main thread is blocked. It’s just not possible to analyze what exactly is blocking the flow. Please help me figure it out.
https://drive.google.com/file/d/1QvFK4y79CG0fBMrJPOrBCTuWsOaqichY/view?usp=share_link <- trace
Hi Mr. Moro,
When you look at the Heaviest Stack Trace or generally the frames in the call tree, you'll see that there are a lot of frames coming from SwiftUI. However, most of the frames are not symbolicated (there are just hex numbers instead of proper function names) which makes it hard to tell what's going on.
There are two things you can do to find out more about what might be going on:
- It seems you recorded your target on macOS Sonoma. In Sonoma, there is no symbolication information for SwiftUI. However, in macOS Sequoia we were able to add symbolication information for SwiftUI, so if you are able to run this on the latest beta of macOS Sequoia, you should be able to get function names for the SwiftUI frames and this might help you to better understand what is happening.
- Since the time seems to be spent somewhere in SwiftUI, I recommend adding the SwiftUI View Body instrument to your document (or simply use the SwiftUI template) and record again. This might show you whether any of your views take a long time to render or there are maybe many more instances of a view than you expect that are being created.