从 Java 生成的进程的核心转储

发布于 2024-08-03 14:39:56 字数 278 浏览 2 评论 0原文

我的 Java (Eclipse) 应用程序正在生成一个子进程,监视其标准输出流和退出值。当子进程因 SIGABRT 崩溃时,不会创建核心转储文件。如果我手动启动子进程并终止它,核心转储就在那里。

我找不到任何有关 JVM 是否以某种方式准备子进程的信息(例如将核心转储文件大小设置为 0)。

有谁知道可能会发生什么以及需要更改哪些设置才能创建核心转储?

这是在 Suse 10 和 Ubuntu 9.04 上,以及 Java 5 和 6(如果有什么区别的话)。

此致, 弗拉德

My Java (Eclipse) application is spawning a child process, monitoring its stdout stream and exit value. When the child process is crashing with SIGABRT, there is no core dump file created. If I start the child process manually and kill it, the core dump is there alright.

I couldn't find any info about whether the JVM prepares somehow the child process (for example setting the core dump file size to 0).

Does anybody know what might be going on and what settings to change so that the core dumps are created?

This is on Suse 10 and Ubuntu 9.04, with Java 5 and 6, if it makes any difference.

best regards,
Vlad

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

神回复 2024-08-10 14:39:56

通常,核心文件的(非)创建由 ulimit 命令(特别是 ulimit -c)控制。有关详细信息,请参阅 help ulimit(在 bash 中)。

此设置应从 shell 继承到子 shell,因此 Java 应使用启动它的 shell 中的设置。 Java 可能会搞乱 ulimit,但我从未听说过它这样做。

尝试在 shell 中设置 ulimit,然后从那里启动 Java 进程。如果这没有帮助,您可以从 Java 调用一个包装器脚本来设置 ulimit,然后启动您的程序。

Normally, the (non-)creation of core files is controlled by the ulimit command (specifically ulimit -c). See help ulimit (in bash) for details.

This setting should be inherited from shell to subshell, so Java should use the setting in the shell it was started from. Java might mess with ulimit, but I've never heard of it doing this.

Try setting ulimit in a shell, then starting your Java process from there. If that does not help, you could invoke a wrapper script from Java which sets ulimit, then starts your program.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文