LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-27-2010, 03:33 PM   #1
moonmoth
Member
 
Registered: Nov 2004
Location: Tallahassee, FL
Distribution: Fedora Core 15
Posts: 95

Rep: Reputation: 17
How do I set core file size?


I am getting a segmentation fault with a core dump,running a new C program, but the core file size is set to zero ("ulimit -a") so no core file to use with gdb. I tried "ulimit -c unlimited" both as me and as root, but it doesn't change. Still zero. Any suggestions? Thanks in advance for your knowledge and your trouble.
 
Old 07-27-2010, 07:36 PM   #2
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
kernel core dump pattern

Strange. I just tried the way you did it, and it worked fine for me. However, I have already pre-set a core dump pattern - maybe that makes the difference? Perhaps without setting the core dump pattern first, the limit is irrelevant and thus not getting set (though I was fairly sure there was a default pattern)?

To test, you might try first putting the following into your /etc/sysctl.conf file (or comparable file on Fedora, whatever that may be):
Code:
# allow core dumps of crashed processes:
# %e = executable, %p = pid
kernel.core_pattern=core.%e.%p
And to activate that immediately, use:
Code:
shell# sysctl -p /etc/sysctl.conf
..though it should also activate automatically during boot if you have a line somewhere in your init scripts which activates the sysctl parameters.

Or to do that single argument from the command line like so:
Code:
root@reactor: sysctl kernel.core_pattern=core.%e.%p
Now see if changing the amount using `ulimit -c` has any effect?
 
1 members found this post helpful.
Old 07-27-2010, 08:53 PM   #3
moonmoth
Member
 
Registered: Nov 2004
Location: Tallahassee, FL
Distribution: Fedora Core 15
Posts: 95

Original Poster
Rep: Reputation: 17
Yes, that did it. And the /etc/sysctl.conf file is the same on Fedora, by the way. Thank you.
 
Old 07-27-2010, 09:02 PM   #4
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
Good stuff - glad to hear it!

Friendly reminder: you can mark this [SOLVED] using Thread Tools near the top of the page.

Best of success.
 
Old 07-27-2010, 09:21 PM   #5
moonmoth
Member
 
Registered: Nov 2004
Location: Tallahassee, FL
Distribution: Fedora Core 15
Posts: 95

Original Poster
Rep: Reputation: 17
Didn't know that. Now I do. My gem of learning for this day. :-)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
core file size problem jose_y Linux - General 1 07-08-2008 05:21 PM
Can logrotate set limits on archived file size? 0xdefec8 Linux - Server 1 04-05-2008 08:22 PM
is this the correct/best way to set file size? George2 Programming 8 07-18-2006 11:19 PM
Fedora Core 2 + KDE, can´t set mouse pointer size in .Xdefaults rlinuz Fedora 0 06-20-2004 12:23 PM
Core File Size bspicer Linux - General 3 04-16-2002 04:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration