如何生成的Linux核心转储当进程得到一个分段错误? [英] How to generate a core dump in Linux when a process gets a segmentation fault?

查看:116
本文介绍了如何生成的Linux核心转储当进程得到一个分段错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Linux的一个过程,是越来越分段错误。我怎么能告诉它生成一个核心转储时失败?

I have a process in Linux that's getting a segmentation fault. How can I tell it to generate a core dump when it fails?

推荐答案

这取决于什么壳您正在使用。如果你使用bash,然后ulimit命令控制与执行程序若干设置,例如是否应该转储核心。如果您键入

This depends on what shell you are using. If you are using bash, then the ulimit command controls several settings relating to program execution, such as whether you should dump core. If you type

ulimit -c unlimited

然后会告诉bash的,其程序可以转储任意大小的核心。您可以指定一个大小如52M,而不是无限的,如果你想要的,但在实践中,因为核心文件的大小,可能永远不会成为一个问题,你这不应该是必要的。

then that will tell bash that its programs can dump cores of any size. You can specify a size such as 52M instead of unlimited if you want, but in practice this shouldn't be necessary since the size of core files will probably never be an issue for you.

在tcsh中,您可以输入

In tcsh, you'd type

limit coredumpsize unlimited

这篇关于如何生成的Linux核心转储当进程得到一个分段错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆