LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-03-2007, 04:39 AM   #1
meetolnx
LQ Newbie
 
Registered: Oct 2007
Posts: 2

Rep: Reputation: 0
ulimit -c does not limit the core file size after a particular point


Iam using redhat enterprise server 5 and I have a issue.
Iam using a binary to dump core file upto a size of 30 MB.
I set ulimit -c 5120 to limit the core file size to 20MB through command line.Now I run the binary to dump core.But its not working and the full 30MB file is written.
Till ulimit -c 52 the command works and after this whatever value I give the full core file is written.Any Idea what may be the problem ?
 
Old 10-03-2007, 01:20 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,336

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
Quote:
Originally Posted by meetolnx View Post
Iam using redhat enterprise server 5 and I have a issue.
Iam using a binary to dump core file upto a size of 30 MB.
I set ulimit -c 5120 to limit the core file size to 20MB through command line.Now I run the binary to dump core.But its not working and the full 30MB file is written.
Till ulimit -c 52 the command works and after this whatever value I give the full core file is written.Any Idea what may be the problem ?
The -c parameter is specified as 1024 byte increments. So if you want to set the limit to 20MB then you need:

ulimit -c 20480

-----------------
Steve Stites
 
Old 10-04-2007, 12:08 AM   #3
meetolnx
LQ Newbie
 
Registered: Oct 2007
Posts: 2

Original Poster
Rep: Reputation: 0
Red face

Quote:
Originally Posted by jailbait View Post
The -c parameter is specified as 1024 byte increments. So if you want to set the limit to 20MB then you need:

ulimit -c 20480

-----------------
Steve Stites


Still the core file exceeds the ulimit value

I use the following code to dump core,

char *value = (char *)malloc(30*1024*1024)
char *invalid = NULL

*invalid=1

after I set ulimit -c 20480 , i get a core file
-rw------- 1 root root 31510528 Oct 4 10:26 core.484
 
  


Reply

Tags
ulimit


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
File Size limit? compu73rg33k Linux - Software 1 02-27-2005 10:11 PM
limit file size ust Linux - General 2 02-24-2005 07:33 AM
File Size Limit?? Manuel-H Linux - Software 1 04-16-2004 03:23 AM
File size limit petway56 Linux - General 4 05-07-2003 11:19 PM
file size limit jaysan Slackware 5 07-12-2002 03:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:24 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