top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to save the core file to disk?

+2 votes
795 views

My program Seg faults but cannot find where Ubuntu saves the core file.

I have changed the core_pattern as follows but still no core file:
echo "core.%e.%p" > /proc/sys/kernel/core_pattern

I want to debug and see where it is crashing. Appreciate if someone could help to generate the core file disk.

posted Nov 26, 2013 by Jai Prakash

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

+2 votes

First you should enable writing a core file with a command like

ulimit -c 10000
or 
ulimit -c unlimited 

where the number indicates the max. core size in 1kb blocks. Then you find the core file in your current directory.

answer Nov 26, 2013 by Sumit Pokharna
+1 vote

You can do the following
1. First set "ulimit -c unlimited" on the console.
2. Go to the following file : - " /proc/sys/kernel/core_pattern"
3. set the path where you need to get the core generated under "core_pattern"
example- /var/core_file/core.%e.%p.%t

answer Dec 19, 2013 by Nithin Kp
Similar Questions
+2 votes

I'd like to ensure core files go to a local partition rather than the default location ($HOME), which is network-mounted in my case.

Googling a bit, I found this: https://access.redhat.com/site/solutions/61536

In light of that, a few questions... Does this still apply to abrt in Fedora 19?

That page suggests that when abrt is in use, core files would be generated in the location set by abrt, which defaults to /var/spool/abrt. However, I have abrtd running and I'm definitely getting core files in $HOME. Does abrt just make a copy to put in /var/spool/abrt?

Might my problem be resolved as simply as telling abrt not to make a copy? I'd be fine with just having the core files in /var/spool/abrt. Otherwise, I imagine I'd like them somewhere named /var/users/$USER/dump
(or similar). How do I do that and continue to play nicely with abrt?

+1 vote

I want to see why my linux system got crashed,
Can anyone please tell where will be the dump file/ How to debug it?

+4 votes

What are the information we can find from core file?

...