linux - 什么实际打印 "Segmentation fault"?

标签 linux segmentation-fault

当发生错误时,哪个二进制文件或代码片段在控制台上打印Segmentation fault

最佳答案

当启用作业控制时,这就是调用 shell 的作业。用 bash 演示:

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

关于linux - 什么实际打印 "Segmentation fault"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32564735/

相关文章:

c - 处理器负载测试程序只生成 3 个线程,但我们需要更多

linux - TLB 中的内核内存(虚拟地址条目)?

C: "Invalid free(): Address 0x7feffee08 is on thread 1' s 堆栈”

c++ - 文件无法打开,在调试器之外运行会导致段错误 (c++)

c - strncpy导致段错误

c - 指向另一个结构中的一个结构的指针,从文件中写入和读取它会产生 SegFault

python - 尝试安装 discord.py,它说 "no module named pip"

c - 基本 shell 程序的管道问题

c++ - Eclipse Ubuntu 中的 “Program is not a recognized executable” 错误

c - 根据教授的说法,代码中的段错误应该有效