开发者

(Mac) leave core file where the executable is instead of /cores?

I recently found out that Mac leaves all the core file in /cores directory.

It's hard to tell what application caused the core dump if even possible.

Wonder if I can configure system to leave the cores where the exe开发者_高级运维cutable resides as in Linux.

Thank you


Hmm - maybe you can edit /etc/sysctl.conf and help yourself you specifying the core_pattern?

kernel.core_pattern=/cores/core.%e.%p.%h.%t

Maybe that would help you find out more about which process was responsible for the dump


You can use the sysctl command to edit corefile path

sudo sysctl -w kern.corefile=/this/is/new/path

By default kern.corefile=/cores/core.%P, %P refer to process id. It can be replace by %N => process name, %U => user name. You can check the source code here

if you want to disable core dump, using the following command

sudo sysctl -w kern.coredump=0

or edit /etc/sysctl.conf, add this line

kern.coredump=0
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜