Invoke Mac Kernel Panic?

半腔热情 提交于 2021-02-06 09:18:23

问题


So i am lookin for some source code to crash the mac kernel. I found crashme for debain linux but that does not work for the mac kernel. So i was wondering if anyone knows where i can find a command-line utility or some source code to invoke the mac kernel panic? This would be a huge help, thanks.


回答1:


Apple has a tech note about how to do this. The short way to do it is with this command, sudo dtrace -w -n "BEGIN{ panic();}", run from the terminal.

Update 2020: As noted by Wei Shen in the comments, you'll need to disable SIP to make this work in modern versons of macOS.




回答2:


I recently updated crashme to work on Mac OS X Lion. You will need to download the source code from http://crashme.codeplex.com/ and compile it using Xcode command line tools. More details are in a answer to question 5085136. But note that crashme hasn't found any immediate kernel panics on the Mac yet. However, after running crashme on the native MacBook Pro, and running it in VirtualBox VM's on the same machine, one in an x86 PC-BSD and another in an x64 Centos, my Lion Kernel became unhappy enough that it threw a kernel panic a few minutes later as I was editing a file using the native Emacs. So crashme may have stumbled upon a kernel bug.




回答3:


Go in terminal and type "killall kernel_task" it should force the computer into a panic without downloading any software. Just make sure you have everything saved before you try :D




回答4:


although this requires a password it works every time sudo halt



来源:https://stackoverflow.com/questions/8828329/invoke-mac-kernel-panic

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!