How to simulate a process / daemon crash on OSX?

How can I invoke / simulate process / daemon crash on OSX and as a result get crash report in

/ Library / Logs / DiagnosticRepors

(e.g. opendirectoryd_2013-06-11-125032_macmini61.crash )?

I tried to force the force to leave for daemons using Activity Monitor, but did not receive any report. I need to bring down some kind of system or third-party process (NOT developed by myself).

+4
source share
2 answers

If you cannot find a legitimate error and make it crash in this way, you cannot violate the daemon in such a way that this will lead to a diagnostic report. All forced crowding-out functions are exempt from diagnostic reports because they are external problems.

+2
source

You can make almost any process crash by sending it a "segmentation violation" signal.

Example: find the process identifier "opendirectoryd":

  $ ps -ef |  grep opendirectoryd
     0 15 1 0 9:14 am ??  0: 01.11 / usr / libexec / opendirectoryd
           ^ - process id

Send a signal to the process:

  $ sudo kill -SEGV 15

This completes the process and creates a diagnostic report, as it can be checked in "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

But note that deliberately failing system services can cause serious problems (system instability, data loss, ...), so you must know exactly what you are doing.

+8
source

Source: https://habr.com/ru/post/1485989/


All Articles