Define the freeze symptom before naming a deadlock
Record node, operating system, exact Asterisk branch and build, package or source provenance, executable, process ID, start time, recent change, workload, call symptoms, remote-CLI behavior, CPU, memory, taskprocessor depth, service-manager state and synchronized incident window. Distinguish a stopped process, overloaded host, blocked console, taskprocessor backlog, external dependency wait and apparent call freeze from a demonstrated lock cycle.
A process that accepts TCP or retains a PID is not proven healthy. An unresponsive CLI, queued work, high CPU, quiet log or restart recovery does not by itself prove a deadlock, the responsible thread or a fixed service.
Prove the diagnostic build and command contract
Asterisk documents that core show locks requires a build with DEBUG_THREADS, and says useful lock stacks generally also need BETTER_BACKTRACES; the current backtrace guidance separately requires retained debug symbols and recommends DONT_OPTIMIZE. Preserve Menuselect state, exact installed binary, running executable and core show settings build options separately.
The documentation warns that DEBUG_THREADS can reduce performance, primarily through CPU consumption. A selected compiler option, installed package or available source tree does not prove that the running service contains the option, symbols or command.
Capture threads, locks and workload as one incident set
core show threads inventories running threads without special compiler flags. With the documented build prerequisites and supported library environment, core show locks can show held locks and the stacks that led to lock calls. Capture each command, timestamp, process uptime, workload and output status in the same narrow window.
An empty lock view, one held lock or one waiting thread is not a causal deadlock finding. Align the lock snapshot with taskprocessor statistics, channel and bridge counts, narrow logs and the user-visible symptom without assuming that every busy or waiting thread belongs to the affected call.
Pair lock output with a symbolized all-thread backtrace
Asterisk deadlock guidance calls for an all-thread debugger backtrace gathered immediately before or after core show locks. Preserve the exact executable, process ID, modules, symbol packages, debugger command, attach and detach result, output file and clock relationship. Check for optimized-out frames and unresolved symbols before escalation.
The legacy deadlock page is explicitly scoped to releases before 13.14.0 and 14.3.0. Use the current backtrace guidance for a current branch and treat older commands as version-labelled evidence rather than a universal script.
Control debugger, core and logging impact
Debugger attachment, forced core collection, instrumented builds, high verbosity and protocol traces can pause processing, consume CPU or storage, expose data or terminate service depending on the selected method and platform. Use an approved reproduction or maintenance window with owner, abort threshold, free-space check, call-impact plan and rollback.
Collect only the requested logger and channel-driver interval, then restore normal levels. Do not force a core, restart Asterisk or broaden debug merely to obtain an artifact when a less disruptive thread and lock snapshot answers the evidence question.
Sanitize, escalate and verify a correction separately
Asterisk issue guidance asks for attached debug files rather than long pasted output. Logs, CLI output, core files and backtraces can expose credentials, call history, identifiers, memory contents and source paths. Keep restricted originals, make a reviewed redacted issue copy and record custody, recipients and retention.
Escalate exact environment, modifications, third-party modules, reproduction, lock output and symbolized all-thread stacks. A developer hypothesis, patch, restart or disappearing symptom remains separate from a repeatable causal finding and a verified ordinary-call restoration.
Sources & applicability
Primary references for the technical details above. Operational examples and planning checklists are VoIP.info editorial guidance.
- Asterisk CLI commands useful for debugging ↗
- Asterisk getting a backtrace ↗
- Asterisk legacy backtrace and deadlock workflow ↗
- Asterisk issue guidelines ↗
- Asterisk collecting debug information ↗
- Asterisk Menuselect options ↗
- Asterisk log security ↗
- Asterisk logging configuration ↗
Examples require adaptation to your topology. No live PBX or hardware testing is claimed.