Coredump Limit?!

Jeremy Allison jra at samba.org
Fri Mar 4 17:49:51 UTC 2016


On Thu, Mar 03, 2016 at 02:20:42PM -0500, Ira Cooper wrote:
> I found this code while tracing down some issues recently.
> 
> "What is setting the core limit to 16 megs?" :)
> 
> Now-a-days, we should just honor the OS corelimits.  Or if we really want
> this code, we should set the limit to something sane, for a modern machine.
> 
> I personally advocate its removal.  Patch enclosed.
> 
> Thanks,

LGTM. Pushed !

> From 61a839500a5adbf3380f874bde2f1f06396ebc5e Mon Sep 17 00:00:00 2001
> From: Ira Cooper <ira at samba.org>
> Date: Thu, 3 Mar 2016 13:47:32 -0500
> Subject: [PATCH] source3: Honor the core soft limit of the OS.
> 
> We should honor the soft limits set by the operating system.
> 
> In any case, 16M doesn't make a useful coredump for modern
> Samba.
> 
> Signed-off-by: Ira Cooper <ira at samba.org>
> ---
>  source3/lib/dumpcore.c | 15 ---------------
>  1 file changed, 15 deletions(-)
> 
> diff --git a/source3/lib/dumpcore.c b/source3/lib/dumpcore.c
> index 487ccec..c72aa88 100644
> --- a/source3/lib/dumpcore.c
> +++ b/source3/lib/dumpcore.c
> @@ -251,21 +251,6 @@ void dump_core_setup(const char *progname, const char *log_file)
>  		goto out;
>  	}
>  
> -
> -#ifdef HAVE_GETRLIMIT
> -#ifdef RLIMIT_CORE
> -	{
> -		struct rlimit rlp;
> -		getrlimit(RLIMIT_CORE, &rlp);
> -		rlp.rlim_cur = MAX(16*1024*1024,rlp.rlim_cur);
> -		setrlimit(RLIMIT_CORE, &rlp);
> -		getrlimit(RLIMIT_CORE, &rlp);
> -		DEBUG(3,("Maximum core file size limits now %d(soft) %d(hard)\n",
> -			 (int)rlp.rlim_cur,(int)rlp.rlim_max));
> -	}
> -#endif
> -#endif
> -
>  	/* FIXME: if we have a core-plus-pid facility, configurably set
>  	 * this up here.
>  	 */
> -- 
> 2.5.0
> 




More information about the samba-technical mailing list