public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ian Lance Taylor <iant@golang.org>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: Tom de Vries <tdevries@suse.de>, Nathan Sidwell <nathan@acm.org>,
		GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [backtrace] Avoid segfault
Date: Wed, 30 Jan 2019 02:21:00 -0000	[thread overview]
Message-ID: <CAKOQZ8y8gyeJcET1MNFpXE4bYYVk=EM+7UKtk5WtfEa5_3Atjw@mail.gmail.com> (raw)
In-Reply-To: <20190129231618.GT14180@gate.crashing.org>

On Tue, Jan 29, 2019 at 3:17 PM Segher Boessenkool
<segher@kernel.crashing.org> wrote:
>
> On Sun, Jan 27, 2019 at 01:53:18PM -0800, Ian Lance Taylor wrote:
> > You need to use a temporary file, such as $@.tmp, for the final sed
> > command, followed by a mv to $@.  Otherwise a failure in the sed will
> > leave what appears to be an up to date file.
>
> Or you just set .DELETE_ON_ERROR, we require GNU make after all so might
> as well use it!

It's useful, but it doesn't help if the file is partially written on
disk and then the computer crashes.  It also doesn't help if the
program is not careful to check for errors on writing to standard
output--many programs aren't--and the disk fills up after writing out
part of the file.  Yes, both cases have happened to me when I was a
release engineer aeons ago, so I try to be careful.

Ian

  reply	other threads:[~2019-01-30  0:50 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-25  0:15 Nathan Sidwell
2019-01-25  1:49 ` Ian Lance Taylor
2019-01-25 13:23   ` Tom de Vries
2019-01-25 14:10     ` Tom de Vries
2019-01-25 14:31       ` Ian Lance Taylor
2019-01-25 17:20       ` Nathan Sidwell
2019-01-25 17:31         ` Marek Polacek
2019-01-27 21:53         ` Tom de Vries
2019-01-28  1:39           ` Ian Lance Taylor
2019-01-28  9:35             ` [libbacktrace] Fix and simplify xcoff_%.c pattern rule Tom de Vries
2019-01-28 11:31               ` [libbacktrace] Add gen-xcoff-n.sh Tom de Vries
2019-01-28 22:29                 ` Ian Lance Taylor
2019-01-28 18:43               ` [libbacktrace] Fix and simplify xcoff_%.c pattern rule Ian Lance Taylor
2019-01-29  8:52             ` [backtrace] Avoid segfault Tom de Vries
2019-01-29 15:29               ` Ian Lance Taylor
2019-01-29 23:53             ` Segher Boessenkool
2019-01-30  2:21               ` Ian Lance Taylor [this message]
2019-01-28 23:19           ` [libbacktrace] Don't assign check_PROGRAMS to TESTS Tom de Vries
2019-01-29  1:08             ` Ian Lance Taylor
2019-01-25 14:23     ` [backtrace] Avoid segfault Ian Lance Taylor
2019-02-25 15:14 Gerald Pfeifer
2019-02-25 21:49 ` Tom de Vries
2019-02-26  8:37   ` Tom de Vries
2019-02-26 21:08     ` Gerald Pfeifer

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='CAKOQZ8y8gyeJcET1MNFpXE4bYYVk=EM+7UKtk5WtfEa5_3Atjw@mail.gmail.com' \
    --to=iant@golang.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=nathan@acm.org \
    --cc=segher@kernel.crashing.org \
    --cc=tdevries@suse.de \
    /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).