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

2024-01-10 Thread Corinna Vinschen
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.
>  
>  
> +
> +The default RLIMIT_CORE is now 0, disabling the generation of core dump or
> +stackdump files. Use e.g. ulimit -c unlimited or ulimit -c
> +1024 to enable them again.
> +
> +
>  
>  
>  
> -- 
> 2.42.1

+1


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

2024-01-10 Thread Jon Turney
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.
 
 
+
+The default RLIMIT_CORE is now 0, disabling the generation of core dump or
+stackdump files. Use e.g. ulimit -c unlimited or ulimit -c
+1024 to enable them again.
+
+
 
 
 
-- 
2.42.1