java - 无法写入核心转储。核心转储已被禁用

标签 java c++ eclipse opencv boost

我一直在从事一个视觉项目,并使用 JNI 编写的一些 Java 中的 C++ 库。

操作系统:Ubuntu 12.04

在我的项目中,我使用的是 boost库来生成随机数。但有时我会遇到如下异常:

Core dum140002367330048 also had an error]
#
# A fatal error has been detected by the Java Runtime Environment:    
#
#  SIGSEGV (0xb) at pc=0x00007f54f72a615a, pid=11979, tid=140002352568064
#
# JRE version: Java(TM) SE Runtime Environment (7.0_67-b01) (build 1.7.0_67-b01)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (24.65-b04 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C  [libCBIR.so+0x3215a]  boost::random::mersenne_twister_engine<unsigned int, 32ul, 624ul, 397ul, 31ul, 2567483615u, 11ul, 4294967295u, 7ul, 2636928640u, 15ul, 4022730752u, 18ul, 1812433253u>::operator()()+0x3a
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again

当我在 StackOverflow 上搜索这个时,我发现了一些与 IDE (Eclipse) 相关的问题。该应用程序独立于 IDE。因此,解决方案也必须独立于 IDE。有什么想法吗?

最佳答案

我遇到了同样的问题。

因为,错误本身表明 -

Failed to write core dump. Core dumps have been disabled. To enable core dumping, try ulimit -c unlimited before starting Java again

ulimit 获取和设置用户限制。有关 ulimit 的更多信息,请执行 -

man ulimit

所以,打开一个终端并运行 -

ulimit -c unlimited

这应该可以解决问题。要检查更改是否成功,请运行 -

ulimit -c -l

这应该会给你一个输出如下 -

core file size          (blocks, -c) unlimited
max locked memory       (kbytes, -l) 64

如果问题仍然存在,请参阅 thisthis来自 askUbuntu .

关于java - 无法写入核心转储。核心转储已被禁用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28982396/

相关文章:

java - 重复捕获组只匹配最后一次出现

java - 在 Eclipse 中调试代码。内循环案例

java - 调用 RandomAccessFile 实例的 setLength 方法时出现无效参数错误

c++ - QML - Q_INVOKABLE 函数

c++ - 如何获取 DirectDraw Last 错误字符串(DirectX 7)

java - 如何使用暂停、线程(任务、服务)模拟队列和堆栈 JavaFX

c++ - #define 预处理器指令可以包含 if 和 else 吗?

java - 部署时 ftp 服务器上的 Maven 转储文件

java - 使用 VisualJVM 在 Eclipse 中测试 Java 项目的性能

android - 如何在 Eclipse for Android 中启用 LogCat/Console?