public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin-patches@cygwin.com
Subject: Re: [PATCH] Cygwin: Make 'ulimit -c' control writing a coredump
Date: Wed, 15 Jun 2022 14:30:05 +0200	[thread overview]
Message-ID: <YqnQzVMifY8j+aK8@calimero.vinschen.de> (raw)
In-Reply-To: <b288ba30-650b-d114-c139-f1f5df6e8958@dronecode.org.uk>

On Jun 15 12:40, Jon Turney wrote:
> On 15/06/2022 12:21, Jon Turney wrote:
> > Factor out pre-formatting a command to be executed on fatal signal, and
> > use that for both error_start (if present in the CYGWIN env var) and for
> > 'dumper'.
> > 
> > Factor out executing that command, so we can use it from try_to_debug()
> > and when a fatal signal occurs.
> > 
> > Because we can't control the size of the core dump written by that, only
> > invoke dumper if the core file size limit is unlimited.
> > 
> > Otherwise, if that limit is greater than 0, we will write a .stackdump
> > file, as previously.
> > 
> > Change the default limit from unlimited to 1 MB, to preserve that
> > existing behaviour.
> 
> Maybe this design tries too hard not to change anything and instead we
> should:
> 
> keep default ulimit -c as unlimited
> 
> ulimit 0     write nothing
> ulimit <=4K  write a .stackdump [*]
> ulimit >4K   write a .core

Sounds good.

> In cases where we wrote something, check afterwards if it's bigger than the
> ulimit and if so, remove it.
> 
> (Maybe this still loses if e.g. 1MB of disk space remains, ulimit is 2MB,
> actual size of coredump is 3MB, since we'll end up with a partial coredump
> when we shouldn't have written anything, but maybe that's what's supposed to
> happen?)

If disk space is low, shit happens.


Corinna

  reply	other threads:[~2022-06-15 12:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-15 11:21 Jon Turney
2022-06-15 11:40 ` Jon Turney
2022-06-15 12:30   ` Corinna Vinschen [this message]
2022-06-22 13:59     ` Jon Turney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YqnQzVMifY8j+aK8@calimero.vinschen.de \
    --to=corinna-cygwin@cygwin.com \
    --cc=cygwin-patches@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).