Suppressing "Known Hang" warnings with PERFC_SUPPRESSION_FILE

Recently we have started refactoring some code to use Swift concurrency in Xcode 15.3. As we have added some new async methods and Tasks, new runtime warnings have emerged titled "Known Hang" and several are listed. None of the stack traces listed with these warnings are in areas directly modified but some of the same types/methods called are also called from the modified areas. So I can sort of understand why they are coming up...but they had to have been there before we added the Swift concurrency.

Example of a tooltip with the warnings:

My first query is: Are these warnings only issued when Swift concurrency is added/applied (as they were not there when using closures and mostly just off the main thread to network calls)?

The documentation indicates these can all be suppressed by turning off the Thread Performance Checker BUT I would rather just suppress the few places as we refactor our codebase (as it is quite large). In that way, any new ones may be documented and we can decide to fix them now or later.

I have tried to follow the instructions and added an environment variable PERFC_SUPPRESSION_FILE (in the Scheme) with a full path to a file formatted similarly to the example in the documentation.

class:NSManagedObjectContext
method:-[NSManagedObjectContext save:]

My second query is: I have verified that the variable is set by reading it from the ProcessInfo. However, regardless of my settings, the runtime warnings are still presented. I could not find any examples or even any mention of others using this environment variable. I am reaching out with any advice or ideas to try. Has anyone successfully tried this or found an issue/alternative?

Help me Mr. Wizard!

A third query: I only see these warnings using the simulator. We are forced to use the Rosetta simulators as a required third-party library that does not support Apple Silicon (I know, I know...but not my company) is being used. However, debugging on a real device does not show these warnings. There is no mention that the Thread Performance Checker is limited to the simulator. Is that the case? I assume the suppression file would not apply (as it is not local to the device itself). Does the suppression file need to be available as a resource within the app bundle for the simulator to find?

Adding async tasks and threads which update the UI on files where main thread is being ran will cause these warnings to show up. Same thing happens on android. The code path you have used which integrates these tasks states they were detected to hang, so it does not mean they will, but they very well could. You should update your code base so you update the UI where it is supposed to be updated. This should fix your problems.

As far as the suppression file is concerned, you'd want to put the suppression file in the bundle. But even after that, it's possible there are entries that need to be fixed in the suppression file. If you'd like us to take a look, can you open a bug report with us and provide the following information:

  1. What does the backtrace of the runtime issue look like in the issue navigator ? If you are willing to do so, can you provide the symbolicated backtrace in the bug report ? A screenshot and a copy-paste of the backtrace from the issue navigator would be helpful.
  2. If your code uses languages that mangle symbol names, can you run symbols <name of binary> on macOS and provide the raw mangled symbols of your binary in the bug report ?
Suppressing "Known Hang" warnings with PERFC_SUPPRESSION_FILE
 
 
Q