Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to write core dump. Core dumps have been disabled

Tags:

I've been working on a vision project and using some C++ libraries in Java by JNI.

OS: Ubuntu 12.04

In my project, I'm using boost library to generate random number. But sometimes I get an exception as follows:

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 

When I searched for this on StackOverflow, I found some issues related to the IDE (Eclipse). The application is independent of the IDE. So, the solution must be independent from the IDE, too. Any ideas?

like image 441
Omurhan Soysal Avatar asked Mar 11 '15 09:03

Omurhan Soysal


People also ask

How do I enable core dumping in Java?

In order to enable core dumps on JDK 9 and above for any OS, you simply add the -XX:+CreateCoredumpOnCrash argument to the Java launcher. If you instead want to disable core dumps, you replace the plus sign with a minus sign: -XX:-CreateCoredumpOnCrash .

What is core dump in Java?

A core dump is a binary file capturing the entire heap contents at the moment the dump is captured. When you load a core dump in Java VisualVM, a node for the core dump appears below the Core Dump node. To view an overview of the core dump, right-click the core dump node and choose Open.

What causes core dump?

A core dump is a file that gets automatically generated by the Linux kernel after a program crashes. This file contains the memory, register values, and the call stack of an application at the point of crashing.


1 Answers

I was experiencing the same issue.

As, the error itself suggests -

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

ulimit gets and sets user limits. For more info on ulimit do -

man ulimit 

So, open a terminal and run -

ulimit -c unlimited 

This should solve the problem. To check if the change was successful, run -

ulimit -c -l 

This should give you an output as follows -

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

If the problem persists refer to this and this from askUbuntu.

like image 158
UrsinusTheStrong Avatar answered Sep 20 '22 09:09

UrsinusTheStrong