Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Empty core dump file after Segmentation fault

Tags:

I am running a program, and it is interrupted by Segmentation fault. The problem is that the core dump file is created, but of size zero.

Have you heard about such a case and how to resolve it?

I have enough space on the disk. I have already performed ulimit -c unlimited to unlimit the size of core file - both running it or putting on the top of the submitted batch file - but still have 0 byte core dump files. The permissions of the folder containing these files are uog+rw and the permissions on the core files created are u+rw only.

The program is written by C++ and submitted on a linux cluster with qsub command of the Grid Engine, I don't know this information is relevant or not to this question.

like image 673
Ali Avatar asked Nov 15 '12 18:11

Ali


People also ask

How do I clear a core dump?

Enter the coredumps command at the pimvasrv:ispim prompt. Enter the help command at the pimvasrv:coredumps prompt for a list of available commands. The following result is displayed: Current mode commands: delete_coredump Delete coredump files.

Where is core dumped segmentation fault?

Core Dump (Segmentation fault) in C/C++ Core Dump/Segmentation fault is a specific kind of error caused by accessing memory that “does not belong to you.” When a piece of code tries to do read and write operation in a read only location in memory or freed block of memory, it is known as core dump.

Why does core dump occur?

A core dump or a crash dump is a memory snapshot of a running process. A core dump can be automatically created by the operating system when a fatal or unhandled error (for example, signal or system exception) occurs. Alternatively, a core dump can be forced by means of system-provided command-line utilities.


1 Answers

setting ulimit -c unlimited turned on generation of dumps. by default core dumps were generated in current directory which was on nfs. setting /proc/sys/kernel/core_pattern to /tmp/core helped me to solve the problem of empty dumps.

The comment from Ranjith Ruban helped me to develop this workaround.

What is the filesystem that you are using for dumping the core?

like image 125
Yuri Pozniak Avatar answered Sep 22 '22 20:09

Yuri Pozniak