[PATCH 2/2] Cygwin: Disable writing core dumps by default.

Corinna Vinschen corinna-cygwin@cygwin.com
Wed Jan 10 15:31:04 GMT 2024


On Jan 10 13:57, Jon Turney wrote:
> Change the default core limit from unlimited to 0 (disabled)
> ---
>  winsup/cygwin/mm/cygheap.cc | 2 +-
>  winsup/doc/new-features.xml | 6 ++++++
>  2 files changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/winsup/cygwin/mm/cygheap.cc b/winsup/cygwin/mm/cygheap.cc
> index a20ee5972..3dc0c011f 100644
> --- a/winsup/cygwin/mm/cygheap.cc
> +++ b/winsup/cygwin/mm/cygheap.cc
> @@ -294,7 +294,7 @@ cygheap_init ()
>        cygheap->locale.mbtowc = __utf8_mbtowc;
>        /* Set umask to a sane default. */
>        cygheap->umask = 022;
> -      cygheap->rlim_core = RLIM_INFINITY;
> +      cygheap->rlim_core = 0;
>      }
>    if (!cygheap->fdtab)
>      cygheap->fdtab.init ();
> diff --git a/winsup/doc/new-features.xml b/winsup/doc/new-features.xml
> index b6daadc2b..a22b78a60 100644
> --- a/winsup/doc/new-features.xml
> +++ b/winsup/doc/new-features.xml
> @@ -99,6 +99,12 @@ is now written on a fatal error. Otherwise, if it's greater than zero, a text
>  format .stackdump file is written, as previously.
>  </para></listitem>
>  
> +<listitem><para>
> +The default RLIMIT_CORE is now 0, disabling the generation of core dump or
> +stackdump files. Use e.g. <code>ulimit -c unlimited</code> or <code>ulimit -c
> +1024</code> to enable them again.
> +</para></listitem>
> +
>  </itemizedlist>
>  
>  </sect2>
> -- 
> 2.42.1

+1


More information about the Cygwin-patches mailing list