我invoke
/ simulate
process
/ daemon
如何在OSX
崩溃并因此收到崩溃报告
/库/日志/ DiagnosticRepors
(例如opendirectoryd_2013-06-11-125032_macmini61.crash
)?
我尝试使用Activity Monitor强制退出守护进程,但没有收到任何报告。我需要崩溃一些系统或第三方进程(不是我自己开发的)。
答案 0 :(得分:12)
您可以通过发送“分段违规”信号强制几乎任何进程崩溃。
示例:查找“opendirectoryd”的进程ID:
$ ps -ef | grep opendirectoryd 0 15 1 0 9:14am ?? 0:01.11 /usr/libexec/opendirectoryd ^-- process id
向流程发送信号:
$ sudo kill -SEGV 15
这将终止该过程并导致编写诊断报告, 可以在“system.log”中验证:
Oct 31 09:17:17 hostname com.apple.launchd[1] (com.apple.opendirectoryd[15]): Job appears to have crashed: Segmentation fault: 11 Oct 31 09:17:20 hostname ReportCrash[420]: Saved crash report for opendirectoryd[15] version ??? (???) to /Library/Logs/DiagnosticReports/opendirectoryd_2013-10-31-091720_localhost.crash
但请注意,故意崩溃系统服务可能会导致严重问题(系统不稳定,数据丢失......),因此您应该确切知道自己在做什么。
答案 1 :(得分:2)
除非你能找到合法的错误并让它以这种方式崩溃,否则你不能以一种导致诊断报告的方式外部崩溃一个守护进程。所有的退出强制功能都免于诊断报告,因为它们是外部问题。