What actually prints “Segmentation fault”?

為{幸葍}努か 提交于 2019-12-24 14:00:42

问题


Which binary or piece of code is printing Segmentation fault on the console when an error occurs?


回答1:


That's the invoking shell's job, when job control is enabled. Demonstration with bash:

$ set +m                    # disable job control
$ bash -c 'kill -SEGV $$'
$ set -m                    # enable job control
$ bash -c 'kill -SEGV $$'
Segmentation fault (core dumped)


来源:https://stackoverflow.com/questions/32564735/what-actually-prints-segmentation-fault

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