Daily iOS
Concurrency

Diagnosing deadlocks

QA reports that the app sometimes freezes completely with no crash log. If you suspect a deadlock, in what order would you track down the cause?

How would an interviewer hear this answer? You'll see whether they'd move on, dig in, or say no, and which sentences would trip you up. Your score doesn't change.
See the short answer

Attach the debugger while it's frozen, look at every thread's backtrace, and find the locks and queues waiting on each other. If it's hard to reproduce, collect stacks from the moment of the hang with watchdog reports or MetricKit hang diagnostics.

Share a question