tags: [macOS, troubleshooting, audio, music]
coreaudiod(Core Audio 守护进程)内部线程循环死锁。
macOS 26.5.1 上,coreaudiod 的音频处理线程之间出现循环等待:
coreaudiod thread A → waiting for thread B → waiting for thread A(deadlock)
任何需要音频的应用启动时都会卡在音频初始化,导致永久挂起。
ls -lt /Library/Logs/DiagnosticReports/ | grep -i music
hang 报告文件名示例:Music_2026-06-21-133137_ShenLiangdeMacBook-Air.hang
# 检查死锁信息
head -100 /Library/Logs/DiagnosticReports/Music_*.hang | strings | grep -i deadlock
关键输出:Deadlock: coreaudiod [...] -> coreaudiod [...] -> coreaudiod [...]
pgrep -l coreaudiod # 查看 PID
ps aux | grep coreaudiod
osascript -e 'do shell script "killall coreaudiod" with administrator privileges'
会弹出系统密码授权对话框,输入密码后 coreaudiod 被终止,launchd 自动重启。
sudo killall coreaudiod
pgrep -l coreaudiod # 确认 PID 已变化(已重启)
open -a Music # 测试启动
| 日期 | 机器 | macOS 版本 | 详情 |
|---|---|---|---|
| 2026-06-21 | MacBook Air M5 (Mac17,3) | 26.5.1 | coreaudiod PID 183 死锁,osascript 授权重启后恢复,新 PID 17057 |